Fails to build apps for Android-- Android target: Command failed with exit code ENOENT

I’m tring to run my project on some android device but fails one of the prerequisites to build andriod app:
When I enter meteor add-platform android
I get:
Status of the individual requirements:
✓ Java JDK
✓ Android SDK
✗ Android target: android: Command failed with exit code ENOENT
✓ Gradle

and this is the later part of the verbose response:

%% This app does not have launcher icons defined
%% This app does not have splash screens defined
%% This app does not have additional resource files defined
%% Prepared android project successfully      
%% No scripts found for hook "after_prepare". 
%% Saving android@6.2.3 into platforms.json   
%% No scripts found for hook "after_platform_add".
android: added platform                       
Checking Cordova requirements for platform Android
%% Running command: /usr/libexec/java_home    
%% Command finished with error code 0: /usr/libexec/java_home 
%% Running command: avdmanager list target    
%% Command finished with error code ENOENT: avdmanager list,target
%% Running command: android list target       
%% Command finished with error code ENOENT: android list,target
                                              
Your system does not yet seem to fulfill all requirements to build apps for Android.
  • I’m using andriod studio and have set $ANDROID_HOME variable followed official guide https://guide.meteor.com/mobile.html#installing-prerequisites-android. Now when type: echo $ANDROID_HOME , shows: /Users/username/Library/Android/sdk which is the correct path

  • I’m using: Macos, Meteor 1.7.0.3, Andriod studio 3.1.2, andriod API 28, Andriod SDK Platfrom-Tools 28.0.0, Andriod SDK Tools 25.2.5 (I downgraded to this version after seeing some other post saying 25.3.x and higher doesn’t work properly with it)

I’ve stuck here for a few days… thanks for any help

solved by downgrading SDK Platform to API level android-26 and Android SDK Platform-tools and Android SDK Build-tools to latest

hey meowacat, could you please confirm the commands/steps you took to “downgrade SDK platform to API level android-26” ? thanks!

So how does one run “Andriod SDK Platfrom-Tools” at the command line? I think I’m getting progress using:

snap install android-studio --classic

sir i too facing the same problem and not getting any solution . please give me the proper solution through which i can resolve it and start working on my project.

please use the screen shots or videos if possible.

It’s almost impossible to downgrade platform-tools now, but I’ve found that using the Cordova plugin: cordova-android-support-gradle-release seems to do the trick since Gradle controls the build setup.

Yes having this problem as well.