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

这一生的挚爱 提交于 2019-12-05 05:52:32
Aqeel iqbal

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).

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.

I also searched for a solution for this but it seems like downgrading to previous android SDK version is what you should do for now.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!