cocos2dx转Andriod常见问题

cocos2dx转Andriod常见问题

1 NDK_ROOT not defined. Please define NDK_ROOT in your environment or in local.properties 在路径cocos2d-x-2.2.2/samples/Cpp/HelloCpp(功成名)/proj.android下的build_native.sh文件中的 APPNAME="HelloCpp"下添加:

NDK_ROOT="/Users/user/Documents/android-ndk-r9c" 
2 导入Eclipse有三个报错 将路径cocos2d-x-2.2.2/cocos2dx/platform/android/java/src/org/cocos2dx/下的lib拷贝到 cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android/src/org/cocos2dx下

3 The connection to adb is down, and a severe error has occurred.
(1) 重启Eclipse (2 )如果重启不行的话就cd到platform-tools下键入adb kill-server ,如果adb关闭了会提示 server not running *,再输入adb start-server 如果不成功会提示 daemon not running. starting it now on port ***的而如果成功的话不提示任何语句的.这时再重新打开eclipse就可以正常运行模拟器的了. 
4 unfortunately, hellocpp has stopped

I fixed the problem by add the following lines in Cocos2dxActivity.java:

// …add to FrameLayout

framelayout.addView(this.mGLSurfaceView);

// NOTICE: to comment it out when you release the application

this.mGLSurfaceView.setEGLConfigChooser(8 , 8, 8, 8, 16, 0);

The problem is because Android emulator can’t support OpenGL ES 2.0 well. But my “solution” is a only a temporary one when you run application in emulator. (The app is fine when I run the app in real device.)

转载自:http://www.2cto.com/kf/201402/282143.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值