minSdkVersion warning even after having put in the value

Last Updated:

  1. MrRobot

    MrRobot Member This Topic's Starter

    Jun 13, 2010
    Likes Received:
    I'm trying to set the minimum SDK version. I'm building my projects from the command line in a Mac dev environment. I changed the AndroidManifest.xml file to this.

    Code (Text):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    3.       package="apt.tutorial"
    4.       android:versionCode=""
    5.       android:versionName="">
    6.     <uses-sdk minSdkVersion="6" />
    7.     <application android:label="@string/app_name" android:icon="@drawable/icon">
    8.         <activity android:name="FirstApp"
    9.                   android:label="@string/app_name">
    10.             <intent-filter>
    11.                 <action android:name="android.intent.action.MAIN" />
    12.                 <category android:name="android.intent.category.LAUNCHER" />
    13.             </intent-filter>
    14.         </activity>
    15.     </application>
    16. </manifest>
    I set the SDK to 6 and having Firmware 2.1-update1 on my phone, I figured that it would be a good test. When I run ant, I get the following warning:
    Code (Text):
    1. % ant                  
    2. Buildfile: build.xml
    3.     [setup] Android SDK Tools Revision 6
    4.     [setup] Project Target: Android 2.1-update1
    5.     [setup] API level: 7
    6.     [setup] WARNING: No minSdkVersion value set. Application will install on all Android versions.
    7.     [setup] Importing rules file: platforms/android-7/ant/ant_rules_r2.xml
    9. help:
    10.      [echo] Android Ant Build. Available targets:
    11.      [echo]    help:      Displays this help.
    12.      [echo]    clean:     Removes output files created by other targets.
    13.      [echo]    compile:   Compiles project's .java files into .class files.
    14.      [echo]    debug:     Builds the application and signs it with a debug key.
    15.      [echo]    release:   Builds the application. The generated apk file must be
    16.      [echo]               signed before it is published.
    17.      [echo]    install:   Installs/reinstalls the debug package onto a running
    18.      [echo]               emulator or device.
    19.      [echo]               If the application was previously installed, the
    20.      [echo]               signatures must match.
    21.      [echo]    uninstall: Uninstalls the application from a running emulator or
    22.      [echo]               device.
    25. Total time: 0 seconds
    This isn't a huge problem, but I don't want to be stuck at 1.0 without trying any of the newer features that are available... anyone know how to fix this?

  2. MrRobot

    MrRobot Member This Topic's Starter

    Jun 13, 2010
    Likes Received:
    The solution was pretty easy, just add "android:" before the minSdkVersion :p . But I got another problem.

    The compiler would complain that the versions were incompatible. The solution is pretty bizarre, I'd have to create a project with a target of 6 and for the minSdkVersion, but for the AndroidManifest.xml I'd set it to 7...

    I'm a little tired at the moment, so I'll have get back to this.
  3. kevin@teslacoilsw

    kevin@teslacoilsw VIP Member VIP Member

    Jun 13, 2010
    Likes Received:
    You can develop against one version of Android but mark the program as being compatible with older versions. This lets you use the new API where available but still run on the older systems. To do that you want:
    Code (Text):
    2.     <uses-sdk android:minSdkVersion="3"
    3.               android:targetSdkVersion="7" />

Share This Page