2013-05-21 69 views
0

我是cocos2d-x的新手。我在Windows 8/Eclipse中配置cocos2d-x,並使用android-ndk-r8b。 我創建了一個項目(的HelloWorld)是running.The程序在模擬器中運行時提供了以下錯誤:Cocos2d-x |在仿真器上運行時出錯

05-21 20:17:14.357: E/AndroidRuntime(336): FATAL EXCEPTION: main 
05-21 20:17:14.357: E/AndroidRuntime(336): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nabeelahmad.molitx/com.nabeelahmad.molitx.moleitx}: java.lang.IllegalStateException: setRenderer has already been called for this instance. 
05-21 20:17:14.357: E/AndroidRuntime(336): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 
05-21 20:17:14.357: E/AndroidRuntime(336): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 
05-21 20:17:14.357: E/AndroidRuntime(336): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 
05-21 20:17:14.357: E/AndroidRuntime(336): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 
05-21 20:17:14.357: E/AndroidRuntime(336): at android.os.Handler.dispatchMessage(Handler.java:99) 
05-21 20:17:14.357: E/AndroidRuntime(336): at android.os.Looper.loop(Looper.java:123) 
05-21 20:17:14.357: E/AndroidRuntime(336): at android.app.ActivityThread.main(ActivityThread.java:3683) 
05-21 20:17:14.357: E/AndroidRuntime(336): at java.lang.reflect.Method.invokeNative(Native Method) 
05-21 20:17:14.357: E/AndroidRuntime(336): at java.lang.reflect.Method.invoke(Method.java:507) 
05-21 20:17:14.357: E/AndroidRuntime(336): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
05-21 20:17:14.357: E/AndroidRuntime(336): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
05-21 20:17:14.357: E/AndroidRuntime(336): at dalvik.system.NativeStart.main(Native Method) 
05-21 20:17:14.357: E/AndroidRuntime(336): Caused by: java.lang.IllegalStateException: setRenderer has already been called for this instance. 
05-21 20:17:14.357: E/AndroidRuntime(336): at android.opengl.GLSurfaceView.checkRenderThreadState(GLSurfaceView.java:1614) 
05-21 20:17:14.357: E/AndroidRuntime(336): at android.opengl.GLSurfaceView.setEGLConfigChooser(GLSurfaceView.java:355) 
05-21 20:17:14.357: E/AndroidRuntime(336): at android.opengl.GLSurfaceView.setEGLConfigChooser(GLSurfaceView.java:392) 
05-21 20:17:14.357: E/AndroidRuntime(336): at com.nabeelahmad.molitx.moleitx.onCreate(moleitx.java:78) 
05-21 20:17:14.357: E/AndroidRuntime(336): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
05-21 20:17:14.357: E/AndroidRuntime(336): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 
05-21 20:17:14.357: E/AndroidRuntime(336): ... 11 more 

任何人有什麼,我丟失或做錯了任何想法?

感謝任何幫助,謝謝。

回答

0

首先,使用最新的NDK(此時爲android-ndk-r8e),較舊的NDK在運行cocos2d-x時遇到問題。其次,檢查您的模擬器是否啓用了「使用主機GPU」選項。

相關問題