Your system does not yet seem to fulfill all requirements to build apps for Android on M1 Mac

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

Problem Description

I’m developing a Meteor project that includes an Android build and I get the above error when running meteor add-platform android or meteor run android-device.

System Details

  • OS: M1 Mac Sonoma
  • Meteor Version: 2.16
  • Java Version: 11 (tried 8 and got different errors)
  • Android SDK target SDK 33, compile SDK 33
  • Gradle 7.4.2

Error Details

When running meteor add-platform android or trying to build and run the project with meteor run android-device, I get the following error:

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 exit code 1: avdmanager list target
    Exception in thread "main" java.lang.NoClassDefFoundError:
    javax/xml/bind/annotation/XmlSchema
    ...

Steps Taken

  1. Environment Variables: Ensured JAVA_HOME and ANDROID_HOME are set correctly:

    export JAVA_HOME="$HOME/.sdkman/candidates/java/11.0.14.1-jbr"
    export ANDROID_HOME="$HOME/Library/Android/sdk"
    
  2. Removed and Re-added Android Platform:

    meteor remove-platform android
    meteor add-platform android
    
  3. Checked SDK Tools: Verified all Android SDK tools are up-to-date via Android Studio.

  4. Tried java version 8: Doing this results errors telling me that I need java 11 for my Gradle build, so I end up with part of the toolchain requiring 8 and part of it requiring 11.

I’m at a loss as to how to proceed.

Any help would be appreciated. Thanks!

This issue sounds familiar to me.

Have you linked properly in your path the cmdline-tools?

Install the latest cmdline-tools package and update your PATH, you might be able to solve this issue with the SDK tools and Java 11.

Within the SDK Manager in Android Studio, go to the SDK Tools tab. Check the Android SDK Command-line Tools (latest). Update your PATH to point directly to the installed version,

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

Actually I have all these, but maybe some requiered different tool installation in the SDK.

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

Hopefully this might help. Let me know how it goes.

You, sir, saved my morning.

Did I just miss this in the docs? After this I had to update to jdk 17 but that was fine by me.

Thank you!

The docs might only mention this briefly. I get a note to enhance the documentation and include this requirement.

I ran into this again today on a different dev machine (also an Apple Silicon Mac).

I dug into it a bit more and found I had in my .zshrc file added $ANDROID_SDK_ROOT/tools to my path, and it was running avdmanager from there.

It apparently should run avdmanager from your latest Android Command Line Tools install, which I have here: $ANDROID_HOME/cmdline-tools/latest/bin

So in my case I needed to remove /tools from the path and add cmdline-tools/latest/bin to it. This is why the accepted answer works; it adds /cmdline-tools/latest/bin to the path.

I’ve permanently added it to my path now. Here is the relevant section:

# Android SDK
export ANDROID_HOME=$HOME/Library/Android/sdk
export ANDROID_SDK_ROOT=${ANDROID_HOME}
export PATH="$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"