Eclipse编译调试Cocos2d问题汇总

来源:互联网 发布:淘宝店铺刷流量有用吗 编辑:程序博客网 时间:2024/06/18 14:16


1、出现无法找到GLE

fatal error: GLES2/gl2platform.h: No such file or directory  

Application.mk 中加上 APP_PLATFORM := android-19(当前使用的安卓版本)

2、libcocos2dx未导入

Cocos2dxActivity cannot be resolved to a type

导入cocos2dx/platform/android/java这个工程即可。

3、导入的JAVA包中出现 XXX cannot be resolved to a type
将..\cocos2d\cocos\platform\android\java\src中的所有文件copy至..\proj.android\src中

4、Program "ndk-build" is not found in PATH
将NDK的跟目录设置至PATH环境变量中

5、真机调试注意事项:
首先需要root手机,连接电脑后在电脑命令行中输入以下内容设置手机调试权限:
1、adb shell
2、su
3、mount -o remount rw /system
4、chmod 4750 /system/bin/run-as
5、mount -o remount ro /system

6、DEBUG时无法进入调试环境
DEBUG时程序运行,但未进入调试环境,出现如下错误提示:
Failed to execute MI command:-target-select remote localhost:5039
进入DEBUG CONFIGS,找到ANDROID NATIVE APPLICATION 选项,在DEBUGGER中将端口改一下(蒙的,没想到就OK了)


7、ADB断点无效
DEBUG时程序能够进入调试环境下运行,但就是不进入断点,存在以下错误信息:
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
warning: Unable to find dynamic linker breakpoint function.
GDB will retry eventurally. Meanwhile, it is likely
that GDB is unable to debug shared library initializers
or resolve pending breakpoints after dlopen().
原因是ADB调试器反应较慢未能挂起至程序上,在程序JAVA代码入口处SLEEP 5~10秒即可。

0 0
原创粉丝点击