e11438
e11438

Reputation: 904

Changing the android target of a cordova project

i'm new to cordova development and i created my first cordova project using this command as in following site https://cordova.apache.org/docs/en/4.0.0/guide_cli_index.md.html

 cordova create hello com.example.hello HelloWorld

After used these commands to add a platform to project,

 cd hello
 cordova platform add android

and command line gives these output

    Adding android project...
    Creating Cordova project for the Android platform:        
    Path: platforms\android
    Package: com.exampple.hell
    Name: helloWorld
    Android target: android-21
    Copying template files...
    Project successfully created.

according to this Android target of this project is android-21 but installed android SDK on my machine only has up to android API level 19. So when i import these project to eclipse IDE to make further changes to project it gives error on console

Unable to resolve target 'android-21'

I changed AndroidManifest.xml file as

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" /> 

but still have the problem.

can i change the android target to 19 when the platform is added to project or is there another way to fix this and run project with android API level 19

Upvotes: 0

Views: 14299

Answers (1)

nimesulide
nimesulide

Reputation: 228

You should update your SDK on your machine first of all. The compatibility depends on your config.xml file content.

For example you want to support android levels from 16 to 19, then this part of the config.xml should look like this:

<preference name="android-minSdkVersion" value="16"/>
<preference name="android-targetSdkVersion" value="19"/>

The build method then takes care of AndroidManifest.xml.

Upvotes: 14

Related Questions