昨天晚上打包之前好好项目,突然就编译不了了。
我想,诶,这不对啊,明明是好好的项目怎么就突然不行了呢?
log日志
* What went wrong:
Execution failed for task ':BCYL:externalNativeBuildRelease'.
> Build command failed.
Error while executing process /Users/mac/Toolkit/android-ndk-r10e/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/mac/Project/Cocos/BCYL/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk NDK_APPLICATION_MK=/Users/mac/Project/Cocos/BCYL/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-16 NDK_OUT=/Users/mac/Project/Cocos/BCYL/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=/Users/mac/Project/Cocos/BCYL/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-22 NDK_MODULE_PATH=/Applications/CocosCreator.app/Contents/Resources/cocos2d-x:/Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos:/Applications/CocosCreator.app/Contents/Resources/cocos2d-x/external -j12 NDK_DEBUG=0 /Users/mac/Project/Cocos/BCYL/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj/local/armeabi-v7a/libcocos2djs.so}
Android NDK: WARNING: Ignoring unknown import directory: /Applications/CocosCreator.app/Contents/Resources/cocos2d-x
Android NDK: WARNING: Ignoring unknown import directory: /Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos
Android NDK: WARNING: Ignoring unknown import directory: /Applications/CocosCreator.app/Contents/Resources/cocos2d-x/external
Android NDK: /Users/mac/Project/Cocos/BCYL/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk: Cannot fi/Usernd mso/dmualce/ Pwriotjhe ctta/gC o'csocsr/iBpCtYiLn/gb/ujisl-db/ijnsdbi-nbgisn/aprryo/jf.raanmderwooirdk/sp/rreubnutiilmte--src/mprko'j .iann dirmopiod-studrito /paaptph/ j n i /
Android.mk:37: *** Android NDK: Aborting. . Stop.
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
百度了一下,有改NDK_MODULE_PTAH的,有替换$(call import-module,./prebuilt-mk)为
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
$(call import-module,../../cocos2d/cocos)
我试了一下,都不对(其实第一个太麻烦,懒得试)
我想了想,我也没干什么啊,就装了新版的cocos creator还有nodejs,这跟这有什么关系呢?
———————————————————————————————————————————————
嗯,下面是重点,
Android NDK: WARNING: Ignoring unknown import directory: /Applications/CocosCreator.app/Contents/Resources/cocos2d-x
Android NDK: WARNING: Ignoring unknown import directory: /Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos
Android NDK: WARNING: Ignoring unknown import directory: /Applications/CocosCreator.app/Contents/Resources/cocos2d-x/external
我为了装两个版本的creator,把名字加了版本号,路径错了,改了路径完美解决。
仅参考