我已经使用Libgdx游戏引擎开发了一个应用程序,以显示shapefile图层中的功能。为了获得要素的几何形状,我使用了Sevar83移植的适用于Android的Spatilite数据库,其中插入了我的shapefile。以下是我的项目的build.gradle,其中包括Libgdx和Sevar83库的依赖项。
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.studio.testlibgdx"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
configurations { natives }
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.github.sevar83:android-spatialite:2.0.0'
implementation "com.badlogicgames.gdx:gdx:1.9.8"
implementation "com.badlogicgames.gdx:gdx-backend-android:1.9.8"
natives "com.badlogicgames.gdx:gdx-platform:1.9.8:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:1.9.8:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:1.9.8:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:1.9.8:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:1.9.8:natives-x86_64"
implementation "com.badlogicgames.gdx:gdx-freetype:1.9.8"
natives "com.badlogicgames.gdx:gdx-freetype-platform:1.9.8:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-freetype-platform:1.9.8:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:1.9.8:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:1.9.8:natives-x86"
natives "com.badlogicgames.gdx:gdx-freetype-platform:1.9.8:natives-x86_64"
}
问题是在Samsung J1上运行了应用程序,但是在Samsung选项卡S2上却给了我这个错误。是什么导致此问题,我该如何解决?
2019-06-21 11:28:57.022 29298-29298/com.studio.testlibgdx E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.studio.testlibgdx, PID: 29298
java.lang.ExceptionInInitializerError
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1086)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2836)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3042)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1639)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6780)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1500)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1390)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'gdx' for target: Linux, 32-bit
at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:125)
at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:33)
at com.badlogic.gdx.backends.android.AndroidApplication.<clinit>(AndroidApplication.java:63)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1086)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2836)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3042)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1639)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6780)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1500)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1390)
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.studio.testlibgdx-1/base.apk", zip file "/data/app/com.studio.testlibgdx-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.studio.testlibgdx-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.studio.testlibgdx-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.studio.testlibgdx-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.studio.testlibgdx-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.studio.testlibgdx-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.studio.testlibgdx-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.studio.testlibgdx-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.studio.testlibgdx-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.studio.testlibgdx-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.studio.testlibgdx-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.studio.testlibgdx-1/lib/arm64, /data/app/com.studio.testlibgdx-1/base.apk!/lib/arm64-v8a, /data/app/com.studio.testlibgdx-1/split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/com.studio.testlibgdx-1/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/com.studio.testlibgdx-1/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/com.studio.testlibgdx-1/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/com.studio.testlibgdx-1/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/com.studio.testlibgdx-1/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/com.studio.testlibgdx-1/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/com.studio.testlibgdx-1/split_lib_slice_6_apk.apk!/lib/arm64-v8a, /data/app/com.studio.testlibgdx-1/split_lib_slice_7_apk.apk!/lib/arm64-v8a, /data/app/com.studio.testlibgdx-1/split_lib_slice_8_apk.apk!/lib/arm64-v8a, /data/app/com.studio.testlibgdx-1/split_lib_slice_9_apk.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "libgdx.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:972)
at java.lang.System.loadLibrary(System.java:1567)
at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:119)
at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:33)
at com.badlogic.gdx.backends.android.AndroidApplication.<clinit>(AndroidApplication.java:63)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1086)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2836)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3042)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1639)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6780)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1500)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1390)