skip to Main Content

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


  1. Chosen as BEST ANSWER

    Problems that needed resolved:

    1 - Android SDK and Studio was installed as root, changed owner to $USER:$USER
    2 - /dev/kvm permission denied. changed this to 777 which I know is bad so I’ll need to look at that again
    3 - Path issue with cmdline-tools, had to add /latest/bin so the line in my .bashrc file is:
    
    
    export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
    

  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search