Reputation: 84
I'm having issues with my Cordova installation : I installed cordova, Android Studio, Android SDK, Java and defined
JAVA_HOME="/usr/lib/jdk1.8.0_161/bin/java"
ANDROID_HOME="/home/myusername/Android/Sdk/platforms/android-24"
In /etc/environment
. When I go to a Cordova project and type cordova requirments android
, I have the error
Android Studio project detected
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
android: Command failed with exit code ENOENT
Gradle: installed /usr/share/gradle/bin/gradle
When I change ANDROID_HOME
to /home/myusername/Android/Sdk/
, the error becomes
avdmanager: Command failed with exit code 1
I can't find the problem, I didn't found a good answer on the other posts...
Upvotes: 0
Views: 2369
Reputation: 84
I finally found my error. I installed JAVA, but I didn't added it to the alternatives. The solution was to add my freshly installed JAVA version as main JAVA with sudo update-alternatives --config java
Upvotes: 0
Reputation: 11721
You have two errors:
I think this is because ANDROID_HOME should be more like /home/myusername/Android/Sdk/
(the root of the sdk so that the cordova android platform will be able to choose the sdk version)
you need to add to the PATH the folder where the android command is located. This should be /home/myusername/Android/Sdk/tools
Upvotes: 1
Reputation: 1
i think you should try to change ANDROID_HOME to /home/myusername/Android/
Almost adding to PATH
:$HOME/Android/tools:$HOME/Android/build-tools:$Home/Android/platform-tools:$PATH
Otherwise i have export the GRADLE_HOME too.
Good Luck!
Upvotes: 0