LibGdx游戏在Android中没有运行?

时间:2012-12-03 05:10:58

标签: android libgdx

我正在使用LibGdx framwork制作游戏。这对dekstop工作正常但是当试图运行android时        给予例外: -

        12-03 10:39:46.687: E/AndroidRuntime(9487): FATAL EXCEPTION: main
       12-03 10:39:46.687: E/AndroidRuntime(9487): java.lang.NoClassDefFoundError: com.inoXmobile.glowjump.SuperJumper
        12-03 10:39:46.687: E/AndroidRuntime(9487):     at com.inoXmobile.glowjump.GlowJupmAndroid.onCreate(GlowJupmAndroid.java:35)
        12-03 10:39:46.687: E/AndroidRuntime(9487):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
        12-03 10:39:46.687: E/AndroidRuntime(9487):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
          12-03 10:39:46.687: E/AndroidRuntime(9487):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
          12-03 10:39:46.687: E/AndroidRuntime(9487):   at android.app.ActivityThread.access$1500(ActivityThread.java:117)
         12-03 10:39:46.687: E/AndroidRuntime(9487):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
           12-03 10:39:46.687: E/AndroidRuntime(9487):  at android.os.Handler.dispatchMessage(Handler.java:99)
           12-03 10:39:46.687: E/AndroidRuntime(9487):  at android.os.Looper.loop(Looper.java:130)
          12-03 10:39:46.687: E/AndroidRuntime(9487):   at android.app.ActivityThread.main(ActivityThread.java:3687)
         12-03 10:39:46.687: E/AndroidRuntime(9487):    at java.lang.reflect.Method.invokeNative(Native Method)
          12-03 10:39:46.687: E/AndroidRuntime(9487):   at java.lang.reflect.Method.invoke(Method.java:507)
          12-03 10:39:46.687: E/AndroidRuntime(9487):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
          12-03 10:39:46.687: E/AndroidRuntime(9487):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
             12-03 10:39:46.687: E/AndroidRuntime(9487):    at dalvik.system.NativeStart.main(Native Method)I 

将这些jar等文件放在android项目的libs文件夹中: -   ** 1- gdx.jar

2-GDX-后端-的android.jar

3-armeabi

4- armeabi-V7A **

我的Android活动是: -

public class GlowJupmAndroid extends AndroidApplication {
        /** Called when the activity is first created. */
         private PowerManager.WakeLock wl;
          Bundle next;
       @Override
     public void onCreate (Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            this.initialize(new SuperJumper(), false);

          PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
         wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "DoNotDimScreen");
      }

      @Override
     protected void onResume() {
       super.onResume();
       wl.acquire();
       }

 @Override
 protected void onPause() {
  super.onPause();
  wl.release();
 }

}

我的清单文件是: -

   <?xml version="1.0" encoding="utf-8"?>
     <manifest xmlns:android="http://schemas.android.com/apk/res/android"
       package="com.inoXmobile.glowjump"
       android:versionCode="1"
       android:versionName="1.0"
       android:installLocation="auto">
    <application android:icon="@drawable/icon" android:debuggable="true" android:label="@string/app_name">
        <activity android:name=".GlowJupmAndroid"
              android:label="@string/app_name"
              android:configChanges="keyboard|keyboardHidden|orientation"
              android:screenOrientation="landscape">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
       </activity>

     </application>
     <uses-sdk android:minSdkVersion="3"/>
       <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.WAKE_LOCK" /> 
 </manifest> 

请有人建议我为什么会出现这种异常很多次我尝试删除项目并尝试从cod.google运行,清理和新的jar下载,但它无效。

1 个答案:

答案 0 :(得分:1)

这看起来像ADT 17的问题。可以找到一个很好的解释here,但最简单的方法可能是遵循here步骤。