Why "cocos compile -p android" gives "The android command is no longer available." mistake

I am working on a cocos2d-x project. I always compile an Android project with the command cocos cocos compile -p android --android-studio -m debug . But now this command returns 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 not understand the problem. why does this give an error? what have I changed what caused this problem? I am working on Mac OS sierra, Cocos2d-x 3.14.1, Android Studio.

+7
android command-line android-studio sdk
source share
3 answers

After some research into what changes I made to the development environment, the only thing I could come up with was the Android SDK tools. I updated it one day before the launch of this team. I also found an open problem for this on Github: https://github.com/cocos2d/cocos2d-x/issues/17424 This is a known issue that is being handled and promoted. Therefore, the temporary work is to download the previous version of the Android SDK tools and replace it with an updated one. SDKs that worked before: 25.2.3: https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip (mac form), https://dl.google.com/android/repository/ tools_r25.2.3-windows.zip (for windows).

+19
source share

Now you don’t need to go to the previous version of the Android SDK tools. Now you can use the Android SDK Tools 25.3.x.

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

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

then on the console I run the command

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

Build completed successfully.

+1
source share

I was also looking for a solution for this, but it seems like upgrading to a previous version of the Android SDK is what you should do now.

0
source share

All Articles