Cocos Creator Compile Error

how can I solve this problem?

Please recheck your Android NDK, it may not be correctly installed or its version maybe not compatible, I’m using r10c, but arm-linux-androideabi-4.8 toolchain may be absent in r10e

I couldnt find old versions of ndk. My version is r11c. Where I can find r10c version?

I found a r9d link: https://dl.google.com/android/ndk/android-ndk-r9d-darwin-x86_64.tar.bz2

I will format my pc. If again it gives error, i will try r9d. thanks for helps.

I’m almost sure that r11c won’t work, it only contains newer toolchain than 4.8

I formatted my pc and reinstall everything for Cocos Creator (^^).

But there is an error I think it is simple but I dont know how can I fixt it.

Building mode: release
Using Eclipse project : /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android
Android platform not specified, searching a default one…
Can’t find right Android-platform for project : ‘/Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android’. The Android-platform should be equal/larger than 10.

Seems it haven’t found the Android SDK, can you specify it in Creator’s preference panel?

Hi,
I dont understand why happened it.
This is preferences window:

This is also SDK path

@ozergul can you try this in your terminal:

>echo $ANDROID_SDK_ROOT 

@jyinkailej please take a look at this

Hello, there is nothing as answer in terminal

I run this command at terminal

export ANDROID_SDK_ROOT=’/Users/ozergul/Library/Android/sdk’

export PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/tools/lib/x86_64

And now SDK path is shown when I write echo $ANDROID_SDK_ROOT

Now I click Compile button and there are errors…

Building mode: release
Updated project.properties
Updated local.properties
Updated file /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android/proguard-project.txt
Updated project.properties
Updated local.properties
Updated file /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/cocos2d-x/cocos/platform/android/java/proguard-project.txt
Android NDK: WARNING: APP_PLATFORM android-21 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml
Android NDK: WARNING: Unsupported source file extensions in /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android/…/…/cocos2d-x/cocos/scripting/js-bindings/proj.android/Android.mk for module cocos2d_js_static
Android NDK: \
[armeabi-v7a] StaticLibrary : libcocos2d.a
make: /Users/ozergul/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc-ar: No such file or directory
make: *** [obj/local/armeabi-v7a/libcocos2d.a] Error 1
make: *** Waiting for unfinished jobs…
Using Eclipse project : /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android
Android platform not specified, searching a default one…
running: ‘/Users/ozergul/Library/Android/sdk/tools/android update project -t android-21 -p /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android’

Android platform not specified, searching a default one…
running: ‘/Users/ozergul/Library/Android/sdk/tools/android update lib-project -p /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/cocos2d-x/cocos/platform/android/java -t android-21’

Building native…
NDK build mode: release
Parse NDK version from file /Users/ozergul/Library/Android/sdk/ndk-bundle/RELEASE.TXT failed.
NDK_TOOLCHAIN_VERSION: 4.8
running: ‘/Users/ozergul/Library/Android/sdk/ndk-bundle/ndk-build -C /Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android -j4 NDK_MODULE_PATH=/Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android/…/…/cocos2d-x:/Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android/…/…/cocos2d-x/cocos:/Users/ozergul/Desktop/NewProject/build/jsb-default/frameworks/runtime-src/proj.android/…/…/cocos2d-x/external NDK_TOOLCHAIN_VERSION=4.8’

Error running command, return code: 2.

I compiled with android-ndk-r9d… Thanks for answers.

It seems there is still something wrong with the preference settings, I will report it as a bug, thanks !

1 Like

Try moving ant and anything else on your desktop that cc needs, to somewhere in program files or C:. IE; your storage root. Caused problems for me before. All kinds of stuff. Idk why. And IDC because doing this solved many problems for me. May be irrelevant in this case but figured it was worth a mention. Especially since no one could figure it out and I just got lucky by remembering I had never actually put dev stuff on my desktop before. - On mobile. Forgive the haqed post.

android-ndk-r9d will not work, please try r10e

Creator 1.x will pass build environments to cocos console directly, so it will not depend on system environment.

If you move something after the environment variables/paths(correct term?) were set; it could, right? I just thought of that and I assume now that my problem came from this since I had put everything back where it was in the end and that was all it took. :slight_smile: silly me messing with things I don’t understand. I’ll never learn that lesson…thank goodness. Anywomp; thanks. Back to the loony bin for me. Edit: was prolly on .7v back then in my case. Man I’m tired…

Following worked for me on Windows 10 64-bit:
while compiling the android project with cocos2d:
“cocos compile -p android --android-studio”
the above command produced following error “…Android platform not specified, searching a default one…” as also mentioned in the above links.

which I resolved with procedure at following link:

http://cocos2d-x.org/docs/installation/B/index.html

Android-studio 2.1.
Other setting as mentioned in the above link.

if the build fail because something like “build-tools 22.0.1” not found, then refer following link:

I hope that helps you, if you land here… :smile:

still need to use legacy ndk bundle? I am still getting the same issue
Building mode: release
Using Android Studio project : C:\Users\john\Desktop\build\jsb-default\frameworks\runtime-src\proj.android-studio
Building native…
NDK build mode: release
running: ‘“C:\Users\john\AppData\Local\Android\sdk\ndk-bundle\ndk-build” -C C:\Users\john\Desktop\build\jsb-default\frameworks\runtime-src\proj.android-studio\app -j8 NDK_MODULE_PATH=C:\Users\john\Desktop\build\jsb-default\frameworks\cocos2d-x;C:\Users\john\Desktop\build\jsb-default\frameworks\cocos2d-x\cocos;C:\Users\john\Desktop\build\jsb-default\frameworks\cocos2d-x\external NDK_TOOLCHAIN_VERSION=4.9’

Android NDK: Found platform level in ./project.properties. Setting APP_PLATFORM to android-25.
Android NDK: APP_PLATFORM set to unknown platform: android-25.
make: Entering directory C:/Users/john/Desktop/build/jsb-default/frameworks/runtime-src/proj.android-studio/app' make: Leaving directoryC:/Users/john/Desktop/build/jsb-default/frameworks/runtime-src/proj.android-studio/app’
C:/Users/john/AppData/Local/Android/sdk/ndk-bundle/build//…/build/core/setup-app-platform.mk:115: *** Android NDK: Aborting . Stop.
Error running command, return code: 2.