NDK构建失败cocos2d-x

时间:2015-05-07 01:11:27

标签: android linux android-ndk cocos2d-x

在cocos2d-x中编译project.android时出现此错误:
Android NDK: WARNING: APP_PLATFORM android-16 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml make: Entering directory ``/home/maxim/project/cocos2d-x-3.5/Lesson1/proj.android' [armeabi] Compile++ thumb: cocos2dcpp_shared <= HelloWorldScene.cpp make: /home/maxim/project/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-g++: Command not found make: *** [obj/local/armeabi/objs-debug/cocos2dcpp_shared/__/__/Classes/HelloWorldScene.o] Error 127 make: *** Waiting for unfinished jobs.... make: Leaving directory ``/home/maxim/project/cocos2d-x-3.5/Lesson1/proj.android' Ndk build failed!
有什么问题?
有我的.bashrc:
export COCOS_CONSOLE_ROOT=/home/maxim/project/cocos2d-x-3.5/tools/cocos2d-console/bin export PATH=$COCOS_CONSOLE_ROOT:$PATH

export COCOS_TEMPLATES_ROOT=/home/maxim/project/cocos2d-x-3.5/templates export PATH=$COCOS_TEMPLATES_ROOT:$PATH

export NDK_ROOT=/home/maxim/project/android-ndk-r9d export PATH=$NDK_ROOT:$PATH

export ANDROID_SDK_ROOT=/home/maxim/android-sdks export PATH=$ANDROID_SDK_ROOT:$PATH export PATH=$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH

export ANT_ROOT=/usr/share/ant/bin export PATH=$ANT_ROOT:$PATH

1 个答案:

答案 0 :(得分:0)

错误与你的NDK文件夹中缺少的工具链有关,从构建路径我可以看到你正在使用r9D(在撰写本文时),它可能不包含4.8v工具链。再次检查文件夹,然后使用以下命令通过CLI进行构建

cocos compile -p android --ndk-toolchain arm-linux-androideabi-*
其中*将是NDK文件夹文件夹中工具链的版本。