Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why "cocos compile -p android" gives "The android command is no longer available." error

I am working on a cocos2d-x project. i always compile android project using cocos command cocos compile -p android --android-studio -m debug. But now this command returning an error. The android command is no longer available.

For manual SDK and AVD management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
Error running command, return code: 1.
Error running command, return code: 14.

i can't figure out the problem. why this is giving error? what did i changed that caused this issue? I am working on Mac OS sierra, Cocos2d-x 3.14.1, Android Studio.

like image 781
Aqeel iqbal Avatar asked Mar 02 '17 10:03

Aqeel iqbal


2 Answers

After some digging about what changes I made in my development environment, only thing I could think of is Android SDK tools. I updated it one day before I run this command. Also I found an open issue for that in Github : https://github.com/cocos2d/cocos2d-x/issues/17424 This is a known issue which is being handled and under progress. So temporary work around is to download the previous version of android SDK tools and replace it with updated one. SDK tools that was working before : 25.2.3 : https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip (form mac), https://dl.google.com/android/repository/tools_r25.2.3-windows.zip (for windows).

like image 103
Aqeel iqbal Avatar answered Sep 28 '22 03:09

Aqeel iqbal


Now not need to downgrade to previous Android SDK tools version. You can now use Android SDK Tools 25.3.x.

Here is the pull request for the same.
https://github.com/cocos2d/cocos2d-console/pull/410

I deleted all content inside this cocos2d-x-3.14.1\tools\cocos2d-console folder then downloaded this module cocos2d-console and copied all content to cocos2d-x-3.14.1\tools\cocos2d-console
folder.

then on console I run command

cocos compile -p android --android-studio --ap android-24

Build succeed.

like image 21
Abhishek Aryan Avatar answered Sep 28 '22 03:09

Abhishek Aryan