gpt4 book ai didi

java - 在模拟器中运行时,libgdx 在 helloworld 应用程序上抛出异常

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:06:37 25 4
gpt4 key购买 nike

我已按照 http://www.youtube.com/watch?v=vLx_72qxK_0&feature=player_embedded 上的教程进行操作,并使用 libgdx 库创建了一个简单的应用程序,该应用程序使应用程序具有红色背景。

当我将它作为一个独立的桌面应用程序运行时,它工作正常,但是当我运行 -android 版本时,抛出下面的异常并且应用程序无法启动。

02-04 18:25:27.536: W/dalvikvm(456): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/badlogic/gdx/backends/android/AndroidApplication;
02-04 18:25:27.536: W/dalvikvm(456): Class init failed in newInstance call (Lorg/gravity/main/GameAndroidActivity;)
02-04 18:25:27.567: D/AndroidRuntime(456): Shutting down VM
02-04 18:25:27.567: W/dalvikvm(456): threadid=1: thread exiting with uncaught exception (group=0x40015560)
02-04 18:25:27.676: E/AndroidRuntime(456): FATAL EXCEPTION: main
02-04 18:25:27.676: E/AndroidRuntime(456): java.lang.ExceptionInInitializerError
02-04 18:25:27.676: E/AndroidRuntime(456): at java.lang.Class.newInstanceImpl(Native Method)
02-04 18:25:27.676: E/AndroidRuntime(456): at java.lang.Class.newInstance(Class.java:1409)
02-04 18:25:27.676: E/AndroidRuntime(456): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
02-04 18:25:27.676: E/AndroidRuntime(456): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
02-04 18:25:27.676: E/AndroidRuntime(456): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
02-04 18:25:27.676: E/AndroidRuntime(456): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-04 18:25:27.676: E/AndroidRuntime(456): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
02-04 18:25:27.676: E/AndroidRuntime(456): at android.os.Handler.dispatchMessage(Handler.java:99)
02-04 18:25:27.676: E/AndroidRuntime(456): at android.os.Looper.loop(Looper.java:123)
02-04 18:25:27.676: E/AndroidRuntime(456): at android.app.ActivityThread.main(ActivityThread.java:3683)
02-04 18:25:27.676: E/AndroidRuntime(456): at java.lang.reflect.Method.invokeNative(Native Method)
02-04 18:25:27.676: E/AndroidRuntime(456): at java.lang.reflect.Method.invoke(Method.java:507)
02-04 18:25:27.676: E/AndroidRuntime(456): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-04 18:25:27.676: E/AndroidRuntime(456): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-04 18:25:27.676: E/AndroidRuntime(456): at dalvik.system.NativeStart.main(Native Method)
02-04 18:25:27.676: E/AndroidRuntime(456): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load gdx: findLibrary returned null
02-04 18:25:27.676: E/AndroidRuntime(456): at java.lang.Runtime.loadLibrary(Runtime.java:429)
02-04 18:25:27.676: E/AndroidRuntime(456): at java.lang.System.loadLibrary(System.java:554)
02-04 18:25:27.676: E/AndroidRuntime(456): at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:111)
02-04 18:25:27.676: E/AndroidRuntime(456): at com.badlogic.gdx.backends.android.AndroidApplication.<clinit>(AndroidApplication.java:58)
02-04 18:25:27.676: E/AndroidRuntime(456): ... 15 more

有人对这个库有任何经验吗?

最佳答案

通过确保 armeabi 和 armeabi-v7a 文件夹位于 android 项目的/libs 中解决了这个问题。

关于java - 在模拟器中运行时,libgdx 在 helloworld 应用程序上抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9143294/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com