Reputation: 33
I get a really strange problem when I type cordova platforms add android After I've pressed [Enter], I get the following error:
[Error: The command 'android' failed. Make sure you have the latest Android SDK installed, and the 'android' command (inside the tools/ folder) added to your path. Output: ]
But, I've correctly setup my PATH and the proof of that is that when I type android command or java or ant or adb, it's working but not for Cordova apparently.
Could you please help me? Thanks a lot.
Upvotes: 1
Views: 3564
Reputation: 1138
Check your project.properties and AndroidManifest file for the API level of Android SDK against your installed Android SDK.
Steps:
source.properties
file({android sdk}/platforms/Android-x.x/
). Basically find the AndroidVersion.ApiLevel
project.propereties
file({Project_name}/platforms/android/
) and change target=android-xx
acoording to AndroidVersion.ApiLevel
AndroidManifest
file ({Project_name}/platforms/android/
) and change android:targetSdkVersion="xx"
accordingly.Hopefully it will work.
Upvotes: 0
Reputation: 8939
I also came across the same problem while adding android platform for cordova through command prompt.
It is very simple open Android SDK Manager
and install the latest version on Android SDK platform(4.2.2)
As you can see the latest sdk platform version i.e 4.2.2 is installed. So do the same and should solve your problem.
Now try again to run the command to add platform android for cordova.
add platform android
Hope this will help you.
Upvotes: 2