tags:

views:

363

answers:

0

I know that I can have Eclipse build for 1.5 and 1.6 SDKs for different screen densities if I have the following snippet in AndroidManifest.xml

<supports-screens android:anyDensity="false"/>
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4" />

and if I set up my assets in the following manner in res folder:

/res/drawable-hdpi-v4
/res/drawable-ldpi-v4

My default.properties has the following line:

# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=android-4

This setup allows me to create 1.5 and 1.6 builds in Eclipse IDE, but fails with the following error when I try to do a command line build.

Buildfile: build.xml
    [setup] Project Target: Android 1.6
    [setup] API level: 4
    [setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (3) is lower than the project target API level (4)
Target "resource-src" does not exist in the project "<project-name>". It is used from target "compile".

This error comes up whether I use build.xml generated by 1.5 SDK or the 1.6 SDK (with -resource-src, -aidl targets).

I think that on commandline the build.xml is defaulting to 1.5 SDK, I dont know any way of making it work with 1.6+ SDKs and would appreciate any thoughts, comments on this.

My goal is have one script that with will compile for all Android SDKs while supporting different screen densities.

Thanks