Reputation: 9543
I try to get this working and it's driving me nuts:
$ cordova platform add android
The output is:
Creating android project...
/Users/doekewartena/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:126
throw e;
^
Error: Please install Android target 19 (the Android newest SDK). Make sure you have the latest Android tools installed as well. Run "android" from your command-line to install/update any missing SDKs or tools.
at /Users/doekewartena/.cordova/lib/android/cordova/3.5.0/bin/lib/check_reqs.js:80:29
at _fulfilled (/Users/doekewartena/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/Users/doekewartena/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/Users/doekewartena/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:760:13)
at /Users/doekewartena/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:574:44
at flush (/Users/doekewartena/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:419:13)
Error: /Users/doekewartena/.cordova/lib/android/cordova/3.5.0/bin/create: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)
If did run the command android
this are all the things I installed:
I also did:
open ~/.bash_profile
And added:
export PATH=${PATH}:/Users/doekewartena/Documents/adt-bundle-mac-x86_64-20140702/sdk/platform-tools:/Users/doekewartena/Documents/adt-bundle-mac-x86_64-20140702/sdk/tools
But it doesn't help :(
Could someone help.
Upvotes: 98
Views: 66918
Reputation: 11035
Went into the SDK Manager (typing android
into the terminal, assuming it's in your file path)
Selected box next to Android 4.4.2 (API 19)
Clicked button Install 8 packages
Ran original command (in this example cordova platform add android
, although it could be ionic platform add android
, depending on what you're working with)
Upvotes: 24
Reputation: 5254
If your having issues installing the package, ensure you are running 'Android Central' as an administrator... took me 30 mins to work it out!!
Upvotes: 0
Reputation: 965
I also had to change project.properties in the same directory
target=android-19
android.library.reference.1=CordovaLib
Upvotes: 4
Reputation: 398
Here is documentation on how you set up an AndroidManifest.xml document. Every app should have one.
http://developer.android.com/guide/topics/manifest/manifest-intro.html
Upvotes: 0
Reputation: 399
I too was getting the same error 19. I have no idea about AndroidManifest.xml and where it is supposed to be.
In my case, I fixed the error by running the 'android' command from the console, opening the Android 4.4.2 (API19) tree and installing the SDK Platform.
After this was installed the cordova platform add android command worked as desired.
Further to this I had to install a few other elements of API19 to be able to create an android emulator:
I could then create an emulator based on API19 using the Android Virtual Device (AVD) Manager that is included in the android SDK bundle.
Upvotes: 7
Reputation: 2451
Android SDK is not your target Android version. Target Android version 19 is the API level for android Kitkat.So in you SDK manager check if you have Android 4.4.2(API 19) installed. If you want your target API version to be different then change it in ANdroidManifest.xml
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="18" />
Edit these lines. Here android:targetSdkVersion
is your Android version that you are targeting.
Upvotes: 183