Cocos Creator project failed to build for Android App

Hi there, i got trouble when im trying to build my game into Android apk. when i oppened the build log, its tell a few files from Cocos doesnt exist.

here i have a list file that doesnt exist :
- inspector_socket_server.o’: ‘No such file or directory’
- jsb_cocos2dx_network_auto.o’: ‘No such file or directory’
- jsb_cocos2dx_audioengine_auto.o: ‘No such file or directory’
- jsb_cocos2dx_extension_auto.o’: ‘No such file or directory’

i got this error too :
- CCFontFreetype.cpp -> undefined reference to ‘__cxa_thread_atexit’
- clang++.exe: error: linker command failed with exit code 1

i’ve try to change build setting, clean build, delete build project and then build it again but still i got same error. i try to build from android studio and i got this error

Error while executing process E:\Products\android-ndk-r13b\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=E:\BuildCocosCreator\MyGame\jsb-default\frameworks\runtime-src\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=E:\BuildCocosCreator\MyGame\jsb-default\frameworks\runtime-src\proj.android-studio\app\jni\Application.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=0 APP_PLATFORM=android-21 NDK_OUT=E:/BuildCocosCreator/MyGame/jsb-default/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=E:\BuildCocosCreator\MyGame\jsb-default\frameworks\runtime-src\proj.android-studio\app\build\intermediates\ndkBuild\release\lib NDK_TOOLCHAIN_VERSION=clang NDK_MODULE_PATH=E:\BuildCocosCreator\MyGame\jsb-default\frameworks\cocos2d-x;E:\BuildCocosCreator\MyGame\jsb-default\frameworks\cocos2d-x\cocos;E:\BuildCocosCreator\MyGame\jsb-default\frameworks\cocos2d-x\external -j4 NDK_DEBUG=0 E:/BuildCocosCreator/MyGame/jsb-default/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/libcocos2djs.so}

i wonder if it cause by

NDK_PROJECT_PATH=null

, so i was looking for NDK_PROJECT_PATH and try to edit it but i dont know where to change it even i searching it on internet.

I got stuck with this error for a day, anyone know to solve this please ? Thank you

Since I don’t know what version of Creator you’re using, and whether you are compiling with the Editor or with Android Studio, maybe you could try referring to this documentation first: https://docs.cocos.com/creator/manual/en/publish/setup-native-development.html

Thanks for the replies, im using cocos creator 2.4.3 to development and build my project into android apk. Now i’ve been able to build the game, its my bad doesnt follow all the instruction.

But now i have another question, i was checked arm7 and arm64 in build setting. after the compiling is done, i just got release-signed.apk. i didnt found my apk in arm7 and arm64 just like when im building cocos v4 project via android studio. is that i must build via android studio to get arm7 and arm64 ?

You can refer to this document: https://docs.cocos.com/creator/manual/en/publish/publish-native.html#app-abi

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.