解决:cocos2d-2.0-rc2-x-2.0.1在android虚拟机运行报"don't support gles2.0" 问题

网上查找的资料,经证实可行

问题解决步骤如下:(在mac下解决,相信windows下也一样)

一、虚拟机设置:GPU emulation enabled、SDK 4.0.3、API 15

参考:http://www.raywenderlich.com/12065/how-to-create-a-simple-android-game

 

  • Emulator: If you are using the emulator to test AndEngine code, you need a virtual device which has GPU emulation enabled and is running at least Android 4.0.3. So check your virtual device configuration and edit it if your device is not set up appropriately.

 

Andengine3

 

二、修改项目src/com.sinaapp.blueslf包/cocos2dxandroid220类(替换为自己相应的路径)下面方法detectOpenGLES20(),return里面增加条件"|| Build.FINGERPRINT.startsWith("generic"));"

参考:https://github.com/cocos2d/cocos2d-x/issues/1080

import android.os.Build;
private boolean detectOpenGLES20() 
{
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
ConfigurationInfo info = am.getDeviceConfigurationInfo();
return (info.reqGlEsVersion >= 0x20000 || Build.FINGERPRINT.startsWith("generic"));
}

 

三、运行cocos2d-2.0-rc2-x-2.0.1

 

备注:

1、在mac下如何配置cocos2d-x的ios和android环境,请参考:http://www.raywenderlich.com/11283/cocos2d-x-for-ios-and-android-getting-started

2、如何搭建android环境,请参考:http://www.raywenderlich.com/5527/getting-started-with-android-development

posted on 2012-09-11 23:26  jasonslj  阅读(349)  评论(0编辑  收藏  举报

导航