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


#1

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


#2

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