4
08-02 16:44:49.713: E/AndroidRuntime(3172): FATAL EXCEPTION: GLThread 2436
08-02 16:44:49.713: E/AndroidRuntime(3172): Process: com.jmptest.mptestappwarp.android, PID: 3172
08-02 16:44:49.713: E/AndroidRuntime(3172): java.lang.NoClassDefFoundError: com.shephertz.app42.gaming.multiplayer.client.WarpClient
08-02 16:44:49.713: E/AndroidRuntime(3172):     at  appwarp.WarpController.initAppwarp(WarpController.java:78)

每次我尝试使用 libgdx 框架在 Android 上运行 AppWarp 时都会出现上述错误。我遵循了本教程http://appwarp.shephertz.com/game-development-center/java-multiplayer-libgdx-tutorial/并下载了应用程序的源代码并尝试运行它,但是在 android 上运行时遇到了同样的错误. 我认为这可能是 kitkat 的问题,所以我更新了应用程序 warp 库(android-and-java-sdk 之一),但我仍然遇到同样的错误。所以我尝试在我自己的游戏中实现它。它在桌面上运行良好,但是,如上面的错误所示,它在 android 上再次崩溃。它似乎是 NoClassDefFoundError,类是 WarpClient。这是它崩溃的地方:

private void initAppwarp(){
    try {
        WarpClient.initialize(apiKey, secretKey); //this line causes crash
        warpClient = WarpClient.getInstance();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

这直接来自他们的代码,所以我不确定是什么导致了这个问题。当我尝试在 Android 上运行 app ward 时,为什么会崩溃?

4

1 回答 1

3

I solved it. Decided not to delete this question just in case someone else comes across this issue. While the core project contained the libs for app warp, the android project did not. This was causing the app to crash. While the code said there was no error, when the app was compiled, it was compiled without the libs, causing the NoClassDefFoundError. I simply copied the libs over to the android project from the core project, added them to the build path, and launched the app.

于 2014-08-02T20:58:55.480 回答