你在新建hello world项目的时候,最低的sdk版本设置低一点就可以了。。

解决方案 »

  1.   

    一楼正解!!!
    如果你已经建好工程,你可以修改AndroidManifest.xml中的
    <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="21" />
    将里面的minSdkVersion改到Android 2.x匹配的版本,具体版本编号可以参考
    http://blog.csdn.net/happytengfei/article/details/8679709
      

  2.   

    是这样的...如果你已经建好工程,你可以修改AndroidManifest.xml中的
    <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="21" />将里面的minSdkVersion改到Android 2.x匹配的版本,具体版本编号可以参考http://blog.csdn.net/happytengfei/article/details/8679709
      

  3.   

    android:minSdkVersion="8" 值改为你手机的sdk版 本号
      

  4.   

    感谢各位热心帮助!但问题还没解决,仍是未知类型错误
    自动创建的AndroidManifest.xml中没有uses-sdk,偶不知道加在哪
    以下是AndroidManifest.xml,请帮偶看看uses-sdk加得对不对,谢谢!<?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.foo"
          android:versionCode="1"
          android:versionName="1.0">
          <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="21" />
        <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
            <activity android:name="FooActivity"
                      android:label="@string/app_name">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    </manifest>
      

  5.   

    以下是ant release命令返回的结果,看看有没有问题,谢谢!Buildfile: /home/zhou/wj/build.xml-set-mode-check:-set-release-mode:-release-obfuscation-check:
         [echo] proguard.config is ${proguard.config}-pre-build:-check-env:
     [checkenv] Android SDK Tools Revision 24.0.2
     [checkenv] Installed at /home/zhou/Android/Sdk-setup:
         [echo] Project Name: Foo
      [gettype] Project Type: Application-build-setup:
    [getbuildtools] Using latest Build Tools: 21.1.2
         [echo] Resolving Build Target for Foo...
    [gettarget] Project Target:   Android 5.0.1
    [gettarget] API level:        21
         [echo] ----------
         [echo] Creating output directories if needed...
         [echo] ----------
         [echo] Resolving Dependencies for Foo...
    [dependency] Library dependencies:
    [dependency] No Libraries
    [dependency] 
    [dependency] ------------------
         [echo] ----------
         [echo] Building Libraries with 'release'...
       [subant] No sub-builds to iterate on-code-gen:
    [mergemanifest] No changes in the AndroidManifest files.
         [echo] Handling aidl files...
         [aidl] No AIDL files to compile.
         [echo] ----------
         [echo] Handling RenderScript files...
         [echo] ----------
         [echo] Handling Resources...
         [aapt] No changed resources. R.java and Manifest.java untouched.
         [echo] ----------
         [echo] Handling BuildConfig class...
    [buildconfig] No need to generate new BuildConfig.-pre-compile:-compile:-post-compile:-obfuscate:-dex:
          [dex] input: /home/zhou/wj/bin/classes
          [dex] No new compiled code. No need to convert bytecode to dalvik format.-crunch:
       [crunch] Crunching PNG Files in source dir: /home/zhou/wj/res
       [crunch] To destination dir: /home/zhou/wj/bin/res
       [crunch] Crunched 0 PNG files to update ca
       [crunch] che-package-resources:
         [aapt] No changed resources or assets. Foo.ap_ remains untouched-package:
    [apkbuilder] No changes. No need to create apk.-post-package:-release-prompt-for-password:-release-nosign:
         [echo] No key.store and key.alias properties found in build.properties.
         [echo] Please sign /home/zhou/wj/bin/Foo-release-unsigned.apk manually
         [echo] and run zipalign from the Android SDK tools.
    [propertyfile] Updating property file: /home/zhou/wj/bin/build.prop
    [propertyfile] Updating property file: /home/zhou/wj/bin/build.prop
    [propertyfile] Updating property file: /home/zhou/wj/bin/build.prop
    [propertyfile] Updating property file: /home/zhou/wj/bin/build.prop-release-sign:-post-build:release:BUILD SUCCESSFUL
    Total time: 2 seconds
      

  6.   


      <activity android:name="FooActivity"  这一行,在FooActivity前加一个.试试,不行的话在加个FooActivity的完整路径加上(包名.xxx)
      

  7.   


      <activity android:name="FooActivity"  这一行,在FooActivity前加一个.试试,不行的话在加个FooActivity的完整路径加上(包名.xxx)看了您的回复,偶仍不知如何加
    您能否把加好后的AndroidManifest.xml完整地帖出来?谢谢!
      

  8.   


      <activity android:name="FooActivity"  这一行,在FooActivity前加一个.试试,不行的话在加个FooActivity的完整路径加上(包名.xxx)看了您的回复,偶仍不知如何加
    您能否把加好后的AndroidManifest.xml完整地帖出来?谢谢!<?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.foo"
          android:versionCode="1"
          android:versionName="1.0">
          <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="21" />
        <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
            <activity android:name=".FooActivity"
                      android:label="@string/app_name">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    </manifest>在或者
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.foo"
          android:versionCode="1"
          android:versionName="1.0">
          <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="21" />
        <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
            <activity android:name="com.example.foo.FooActivity"
                      android:label="@string/app_name">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    </manifest>
    这2个都试试把,还有你要确定下FooActivity这个类所在的包是不是com.example.foo,如果不是的话,就在第二个方法下替换下