我嘗試使用andeninge進行小遊戲。它在Window XP系統中工作。同一個項目,如果我導入或使用andeninge我得到的運行時間錯誤,如無法在Windows 7中運行andengine
07-25 17:34:43.854: E/AndroidRuntime(280): FATAL EXCEPTION: main
07-25 17:34:43.854: E/AndroidRuntime(280): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.m2f/com.m2f.AndengineActivity}: java.lang.NullPointerException
07-25 17:34:43.854: E/AndroidRuntime(280): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
07-25 17:34:43.854: E/AndroidRuntime(280): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-25 17:34:43.854: E/AndroidRuntime(280): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-25 17:34:43.854: E/AndroidRuntime(280): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-25 17:34:43.854: E/AndroidRuntime(280): at android.os.Handler.dispatchMessage(Handler.java:99)
07-25 17:34:43.854: E/AndroidRuntime(280): at android.os.Looper.loop(Looper.java:123)
07-25 17:34:43.854: E/AndroidRuntime(280): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-25 17:34:43.854: E/AndroidRuntime(280): at java.lang.reflect.Method.invokeNative(Native Method)
07-25 17:34:43.854: E/AndroidRuntime(280): at java.lang.reflect.Method.invoke(Method.java:521)
07-25 17:34:43.854: E/AndroidRuntime(280): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-25 17:34:43.854: E/AndroidRuntime(280): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-25 17:34:43.854: E/AndroidRuntime(280): at dalvik.system.NativeStart.main(Native Method)
07-25 17:34:43.854: E/AndroidRuntime(280): Caused by: java.lang.NullPointerException
07-25 17:34:43.854: E/AndroidRuntime(280): at org.anddev.andengine.ui.activity.BaseGameActivity.onCreate(BaseGameActivity.java:50)
07-25 17:34:43.854: E/AndroidRuntime(280): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-25 17:34:43.854: E/AndroidRuntime(280): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
示例代碼創建一個新項目:
public class DemoGame1 extends BaseGameActivity {
@Override
public void onLoadComplete() {
// TODO Auto-generated method stub
}
@Override
public Engine onLoadEngine() {
// TODO Auto-generated method stub
return null;
}
@Override
public void onLoadResources() {
// TODO Auto-generated method stub
}
@Override
public Scene onLoadScene() {
// TODO Auto-generated method stub
return null;
}
}
而Android應用程序工作正常(它打印的HelloWorld )。
沒有使用任何的Open GL .. – JohnRaja 2012-07-26 07:23:25
感謝您的更新:我的回覆在上面編輯。 – 2012-07-26 21:00:49
謝謝..解決這個問題 – JohnRaja 2012-07-27 04:46:12