简体   繁体   中英

Cocos2D-X on Android not running

I've been trying to get started using Cocos2D-X, because I wanted to play around with the idea of making an app that is compatible with Android and iOS. I have been going through a tutorial ( http://www.raywenderlich.com/11283/cocos2d-x-for-ios-and-android-getting-started ), and it explains how to get the program running using eclipse, but I have followed the steps it details, and not got the same results.

When I run the program in eclipse, it will launch an AVD, which will go to the slide to unlock screen. When I unlock, I am presented with a black screen.

I will include the console log eclipse has produced a the bottom, as it may have said something which might relate as to why I can not get this program to work.

Finally, I will just say, I have not altered any code in the Android project, it is exactly as the Cocos2D-X scripts created it, which is why I am confused as to why it will not work.

Thank you for reading, and I hope you are able to help me.

Console Log:

[2012-07-13 09:59:11 - com.test.samplecocos2dxandroid.samplecocos2dxandroid] ------------------------------
[2012-07-13 09:59:11 - com.test.samplecocos2dxandroid.samplecocos2dxandroid] Android Launch!
[2012-07-13 09:59:11 - com.test.samplecocos2dxandroid.samplecocos2dxandroid] adb is running normally.
[2012-07-13 09:59:11 - com.test.samplecocos2dxandroid.samplecocos2dxandroid] Performing com.test.samplecocos2dxandroid.samplecocos2dxandroid activity launch
[2012-07-13 09:59:11 - com.test.samplecocos2dxandroid.samplecocos2dxandroid] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'Android2.2'
[2012-07-13 09:59:11 - com.test.samplecocos2dxandroid.samplecocos2dxandroid] Uploading com.test.samplecocos2dxandroid.samplecocos2dxandroid.apk onto device 'emulator-5554'
[2012-07-13 09:59:12 - com.test.samplecocos2dxandroid.samplecocos2dxandroid] Installing com.test.samplecocos2dxandroid.samplecocos2dxandroid.apk...
[2012-07-13 09:59:19 - com.test.samplecocos2dxandroid.samplecocos2dxandroid] Success!
[2012-07-13 09:59:19 - com.test.samplecocos2dxandroid.samplecocos2dxandroid] Starting activity com.test.samplecocos2dxandroid.samplecocos2dxandroid on device emulator-5554
[2012-07-13 09:59:21 - com.test.samplecocos2dxandroid.samplecocos2dxandroid] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.test.samplecocos2dxandroid/.samplecocos2dxandroid }

If you are using the latest version of Cocos2d-x which utilizes OpenGL ES 2.0 it will not work under the emulator. The emulator does not support OpenGL ES 2.0. In addition using an emulator is not really useful while developing a game as the performance will be abysmal.

您可能会尝试将“GPU仿真”添加到虚拟Android设备的硬件属性中

您可以使用genymotion模拟器,它支持OpenGL ES 2.0,也可以像本机设备一样工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM