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

3

7

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.

Morris answered 2/3, 2017 at 10:5 Comment(1)
You can Download SDK 24 from here dl.google.com/android/android-sdk_r24.4.1-linux.tgzCoatbridge
M
19

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

Morris answered 2/3, 2017 at 10:5 Comment(0)
B
1

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.

Balzac answered 24/3, 2017 at 22:39 Comment(0)
G
0

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.

Golanka answered 18/3, 2017 at 14:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.