Mac eclipse android编译cocos1.0preview遇到问题解决。
http://blog.csdn.net/kafeidev/article/details/40739525
1、编译遇到下面问题
- **** Build of configuration Release for project test3 ****
- python /Users/yangeric/mCocos/test3/proj.android/build_native.py -b release all
- Android NDK: WARNING: Ignoring unknown import directory: jni/../../cocos2d
- Android NDK: WARNING: Ignoring unknown import directory: jni/../../cocos2d/external
- jni/Android.mk:25: *** Android NDK: Aborting. . Stop.
- Android NDK: WARNING: Ignoring unknown import directory: jni/../../cocos2d/cocos
- Android NDK: jni/Android.mk: Cannot find module with tag './prebuilt-mk' in import path
- Traceback (most recent call last):
- File "/Users/yangeric/mCocos/test3/proj.android/build_native.py", line 159, in <module>
- build(opts.ndk_build_param,opts.android_platform,opts.build_mode)
- File "/Users/yangeric/mCocos/test3/proj.android/build_native.py", line 146, in build
- do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode)
- Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
- Android NDK: The following directories were searched:
- Android NDK:
- File "/Users/yangeric/mCocos/test3/proj.android/build_native.py", line 82, in do_build
- make: Entering directory `/Users/yangeric/mCocos/test3/proj.android'
- make: Leaving directory `/Users/yangeric/mCocos/test3/proj.android'
- The Selected NDK toolchain version was 4.8 !
- raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!")
- Exception: Build dynamic library for project [ /Users/yangeric/mCocos/test3/proj.android ] fails!
- **** Build Finished ****
修改:
- test3/proj.android/jni/Android.mk
编辑.mk文件,这一段
- $(call import-add-path,$(LOCAL_PATH)/../../cocos2d)
- $(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
- $(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos)
替换为
- $(call import-add-path,/Applications/Cocos/frameworks/cocos2d-x/)
- $(call import-add-path,/Applications/Cocos/frameworks/cocos2d-x/external)
- $(call import-add-path,/Applications/Cocos/frameworks/cocos2d-x/cocos)
2、ok,接上面,继续运行,app 会crash,
logcat为
- 11-03 13:27:31.565: A/libc(21894): Fatal signal 11 (SIGSEGV) at 0x00000178 (code=1), thread 21910 (Thread-3932)
修改
- test3/proj.android/build_native.py
查找下面一行
- resources_dir = os.path.join(app_android_root, "../Resources")
改为
- resources_dir = os.path.join(app_android_root, "../res")
ok,运行ok了
相关推荐
淡风wisdon大大 2020-06-06
wangjie 2020-02-02
Ladyseven 2020-10-22
luofuIT成长记录 2020-09-22
Mynamezhuang 2020-09-18
李鴻耀 2020-08-17
yaodilu 2020-08-03
zhoujiyu 2020-06-28
89510194 2020-06-27
CaiKanXP 2020-06-13
MaureenChen 2020-06-12
Phoebe的学习天地 2020-06-07
buttonChan 2020-06-06
xtuhcy 2020-05-20
AlisaClass 2020-05-18
赵家小少爷 2020-05-16