LIBGDX - 添加 Kidoz SDK 导致应用程序崩溃 Android

LIBGDX - adding Kidoz SDK crashes Android app

每当我尝试添加 Kidoz SDK gradle 依赖项时,Android 应用程序会因这些错误而崩溃

Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'gdx' for target: Linux, 32-bit

Caused by: java.lang.UnsatisfiedLinkError: ... /vendor/lib64, /system/lib64]]] couldn't find "libgdx.so"

我正在 Ubuntu 14.04

上编译

project_root/build.gradle

    compile 'com.kidoz.sdk:KidozSDK:0.5.9'

如果我删除此依赖项,一切都会正常运行。如果有帮助,我可以提供一个演示项目。

此答案属于 LibGDX 论坛的 Fringale。 He/She 没有 Whosebug 帐户。

边缘:

I’m not sure why the error only appears after adding the Kidoz SDK, but from the log it looks like the libgdx.so library for the desired architecture (ARM64 I’d say, since it’s looking in com.mobility.kpa-1/lib/arm64) is missing.

The support for 64bit Android natives was added a few versions ago, so maybe your Gradle files are not up-to-date:

  • Make sure the 'copyAndroidNatives' task in your android/build.gradle is correct by comparing it to the current one: build.gradle

  • Check that you have all of those 5 lines in the 'project(":android")' section of the root build.gradle:

   natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
   natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
   natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
   natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
   natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"

Just wanted to add that, the cause of your issue is that build.gradle files are sometimes updated from one libGDX version to another, e.g. to fix a bug or support a new feature like the Android 64bit natives. The blog posts announcing new releases (http://www.badlogicgames.com/wordpress/) usually give specific instructions when it happens. If you want to be on the safe side, every few version you can also download the new setup app, generate an empty project, and compare the resulting build.gradle files to the ones in your project to see if some stuff has changed.