Unable to solve Android target error in Meteor add-platform android

I using a Macbook Pro M1 and decided to do start developing mobile app using Meteorjs framework, since I’ve used the framework for web development. I’ve followed a tutorial online on how to get that going but currently facing a problem:

Your system does not yet seem to fulfill all requirements to build apps for Android.

Please follow the installation instructions in the mobile guide:

Status of the individual requirements:
✓ Java JDK
✓ Android SDK
✗ Android target: android: Command failed with exit code 1
✓ Gradle

It seems that there’s only one requirement that failed, and I’ve searched for the solution but couldn’t find anything that resembles a similar problem that I’m facing. Hoping for you to help point me to the right direction.

I have installed the Android Studio, uninstalled and reinstalled the Android SDK Build-Tools 32, Android SDK Command-line Tools, Android SDK Platform-Tools, and Android Emulator.

and I’ve got Gradle working just fine. Tested building a generic Android app using one of the samples in Android Studio. The build was successful.

But I can’t get the meteor add-platform android to pass the checks. Anyone?

Hi @muhammadpedalme,

I was doing some tests on my M1, and it is giving basically the same error as you had.
My error is: Android target: Command failed with ENOENT: avdmanager list target spawn avdmanager ENOENT
It’s working fine with iOS btw

I’m investigating what is causing this issue, but I think it’s related to some version or misconfiguration on the PATH.

Hi @muhammadpedalme,

  • In order to make it work, you need to set up those PATHs in your .bashrc or .zshrc file

export ANDROID_HOME=$HOME/Library/Android/sdk
export ANDROID_SDK_ROOT=${ANDROID_HOME}
export PATH=${PATH}:${ANDROID_HOME}/emulator
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

I hope that helps

1 Like

Hi, I have the same error when try cordova requirements “Android target: Command failed with ENOENT: avdmanager list target spawn avdmanager ENOENT”. I already set up the PATHS on my .zshrc file and still the same

avdmanager lives on */Android/Sdk/cmdline-tools/latest/bin, or at least on last versions. That is why you should include as part of your path this folder as well

export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin

If that doesn’t solve it please proceed on the next:

  • Which OS are you using? Depending on your OS the Android default home may vary.

Linux: /home/YourUsername/Android/sdk
Mac: /Users/YourUsername/Library/Android/sdk
Windows: C:\Users\YourUsername\AppData\Local\Android\Sdk

  • Which are the contents of your PATH variable when you are in a terminal session? Can you see the references to Android’s SDK path? Use echo $PATH to check it.

  • Double-check the Android paths actually exists and have contents/binaries inside. You may either have the sdk somewhere else or there are missing binaries.

I hope this can help you. Let me know if it solves for you.