NDK build failed

NDK build failed
0.0 0

#1

Hi!
I have problems with compiling HelloWorld app after clear installation of Cocos creator with cocos2d-js v3.13. Build with cocos creator is without problems. When I try build for Android, it fails…
This is log output:

Building mode: release
Using Android Studio project : C:\Users\Petr\Projects\Cocos\HelloWorldApp\build\jsb-default\frameworks\runtime-src\proj.android-studio
running: ‘“C:\Development\Android\sdk\tools\android” update project -t android-10 -p C:\Users\Petr\Projects\Cocos\HelloWorldApp\build\jsb-default\frameworks\runtime-src\proj.android-studio\app’

Updated project.properties
Updated local.properties
Updated file C:\Users\Petr\Projects\Cocos\HelloWorldApp\build\jsb-default\frameworks\runtime-src\proj.android-studio\app\proguard-project.txt
Building native…
NDK build mode: release
NDK_TOOLCHAIN_VERSION: 4.9
running: ‘“C:\Development\Android\android-ndk-r10c\ndk-build” -C C:\Users\Petr\Projects\Cocos\HelloWorldApp\build\jsb-default\frameworks\runtime-src\proj.android-studio\app -j4 NDK_MODULE_PATH=C:/Users/Petr/Projects/Cocos/HelloWorldApp/build/jsb-default/frameworks/cocos2d-x99;C:/Users/Petr/Projects/Cocos/HelloWorldApp/build/jsb-default/frameworks/cocos2d-x/cocos;C:/Users/Petr/Projects/Cocos/HelloWorldApp/build/jsb-default/frameworks/cocos2d-x/external NDK_TOOLCHAIN_VERSION=4.9’

The system can not find path specified
tr: warning: an unescaped backslash at end of string is not portable
Android NDK: WARNING: Ignoring unknown import directory: C
Android NDK: WARNING: Ignoring unknown import directory: /Users/Petr/Projects/Cocos/HelloWorldApp/build/jsb-default/frameworks/cocos2d-x;C
Android NDK: WARNING: Ignoring unknown import directory: /Users/Petr/Projects/Cocos/HelloWorldApp/build/jsb-default/frameworks/cocos2d-x/cocos;C
Android NDK: jni/Android.mk: Cannot find module with tag ‘scripting/js-bindings/proj.android’ in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make.exe: Entering directory C:/Users/Petr/Projects/Cocos/HelloWorldApp/build/jsb-default/frameworks/runtime-src/proj.android-studio/app' make.exe: Leaving directoryC:/Users/Petr/Projects/Cocos/HelloWorldApp/build/jsb-default/frameworks/runtime-src/proj.android-studio/app’
jni/Android.mk:30: *** Android NDK: Aborting. . Stop.
Error running command, return code: 2.

I guess the problem is here:
“The system can not find path specified
tr: warning: an unescaped backslash at end of string is not portable”

Thanks for any help!


#2

Hey there. Not sure if you need this anymore, but in case someone is facing this issue, I’m posting my finding (Cocos Creator v1.5.1).

This issue is caused by the missing Cocos2d-x folder referenced in the build file. I sorted it out by copying the following folder (Size 733 MB)

/Applications/CocosCreator.app/Contents/Resources/cocos2d-x

to the following location

/build/jsb-default/frameworks/

By build is still not compiling though. Now it says “No rule to make AppDelegate.cpp”. But at least previous issue is sorted out. :slight_smile: