"meteor add-platform android" doesn't work because "android list targets --compact" fails


At first I didn’t understand the cause of the problem I encountered, but finally found it. It was due to Android Studio’s change. So I changed this topic’s title.

original post:
This is a similar problem to other topic (Building a meteror app for android does not seem that finds android hove even though is set), but It didn’t work very well to me.

I’m new to meteor and very confused.
I did tutorial at meteor’s official site.

The console log is here: http://paste.ubuntu.com/25376112/

I also did:

$ ~/Android/Sdk/tools/bin/sdkmanager "build-tools;25.0.3"
Warning: File /home/webdev/.android/repositories.cfg could not be loaded.

but nothing changed.
Are there any information I should show?
Please help if possible.

OS is ubuntu 16.04
meteor version is 1.5.1
Android Studio was installed yesterday and Android SDK tools is 26.0.2.

I guess that I might find a clue of this.

It is the file named as check_reqs.js, which is generated in .meteor/local/cordova-build/platforms/android/cordova/lib/ when meteor add-platform android is executed,

The problem happends at line 248 - 249:

var msg = 'Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment     variable.';
return tryCommand('android list targets --compact', msg)

This doesn’t seem to work because of android list targets --compact.
I could make sure it like this:

$ android list targets --compact
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
Invalid or unsupported command "list targets --compact"

Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
android update sdk

$ echo $?

The same problem was posted at Stack Overflow and other web pages:


As there were the discussion at Github, this problem can be solved by:

$ meteor update --release 1.5.2-beta.13

I added gradle after this and copy “templates” directory at <android-studio>/plugins/android/lib to ~/Android/Sdk/tools, then everything worked fine.