I’m not able to run my meteor app on Android as the Android target command failed. Could this be a permissions issue somewhere? The Android SDK installed to /root
and I moved it to /etc
, could that be part of the problem?
Why does this command fail and how can I resolve this?
$ meteor add-platform android
android: added platform
Your system does not yet seem to fulfill all requirements to build apps for Android.
Please follow the installation instructions in the mobile guide:
http://guide.meteor.com/cordova.html#installing-prerequisites
Status of the individual requirements:
✓ Java JDK
✓ Android SDK
✗ Android target: Command failed with EACCES: avdmanager list target
spawn avdmanager EACCES
✓ Gradle
These are my paths set in my .bashrc
file which I’ll tidy up later:
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export ANDROID_HOME=/etc/Android/Sdk
export ANDROID_SDK_ROOT=/etc/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/build-tools
export PATH=$PATH:$ANDROID_HOME/cmdline-tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export ANDROID_BIN=/opt/android-studio-2021.2.1/android-studio/bin
2
Answers
Problems that needed resolved:
This happens because you didn’t configure correctly your PATH for Android Studio.
Check the documentation here: https://guide.meteor.com/cordova.html#installing-prerequisites-android