Reputation: 2554
I saw a lot of thread in here related to this, but any of them helped me.
With Cordova 6.5.0 installed and Android Studio also installed with Android 6.0 (API 23) and Android 4.4 (API 19), I'm trying to run:
cordova requirements
I got the following error:
Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
Ok. I set up the ANDROID_HOME and the PATH:
export ANDROID_HOME=/Users/USER/Library/Android/sdk
export PATH=${PATH}:/Users/USER/Library/Android/sdk/platform-tools:/Users/italoborges/Library/Android/sdk/tools
I also changed inside platforms/project.properties the line:
target=android-23
And inside platforms/android/AndroidManifest.xml the line:
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
And inside platforms/android/CordovaLib/AndroidManifest.xml the same line above.
Right now I'm stuck because I have tried all the possibilities that I found.
Thanks.
Upvotes: 7
Views: 19842
Reputation: 667
Cause the cordova updated, you may skip this answer and see others.
The reason is not only The recent Android SDK tools removed the android
command, but also the file structure of the SDK ,installed by android studio ,has been changed.
You can wait for the fix, or do a temporary fix by you self.
1,Delete all contents of ~/Library/Android/sdk
2,Download https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip ,and unzip it to ~/Library/Android/sdk/tools
3,Open sdk manager in command line (~/Library/Android/sdk/tools/android sdk
),and install the SDKs.You may need to install 5.5.1(API22) and 6.0(API23)
That's all.
Upvotes: 7
Reputation: 11
Check the permission in your ../Android/Sdk/tools
Maybe you need to use
> /Android/Sdk$ chmod -R u+x tools
Upvotes: 0
Reputation: 2327
I solved this problem updating cordova:
cordova platform rm android
cordova platform add android@latest
and then:
cordova run android
Upvotes: 9
Reputation: 661
I solved this problem updating cordova to the latest version.
cordova platform update android@latest
Upvotes: 1
Reputation: 71
If you encounter this problem, the process should be as follows:
1, cordova platform rm android
2, export ANDROID_HOME=/Users/USER/Library/Android/sdk
export PATH=${PATH}:/Users/USER/Library/Android/sdk/platform-tools:/Users/italoborges/Library/Android/sdk/tools
3, cordova platform add [email protected]
(or the one you need)
If you are putting the EXPORTs to the .profile, remember to unlogin, login again so the .profile can take its action.
Reason: if you do not have ANDROID_HOME before setting cordova-android platform, then setting it afterwards will not work, unless you reinstall cordova-android platform.
Upvotes: 2
Reputation: 546
You should update the android platform of your cordova project. Check the blog of cordova official site (HERE!) to learn the last released version of android for cordova. Example: If the last released version of android is 6.2.1, Then you should update the platform to 6.2.1.
On Windows:
cordova platform update [email protected] --save
Upvotes: 7
Reputation: 2554
I found a workaround to fix the error:
https://github.com/apache/cordova-android/pull/367#issuecomment-286166329
Reason of the error:
The latest Android SDK Tools (25.3.1) turfed the android
command, which all of cordova's underlying functionality relied on.
Upvotes: 2
Reputation: 81
I had the same problem.
Succeeded with:
cordova platform rm android
cordova platform add [email protected]
Upvotes: 3