ImportSDKDemo教程问题:找不到byte []的实现dji.midware.natives.SDKRelativeJNI.native_getXXXX(java.lang.String)

问题描述 投票:3回答:1

我在尝试模拟ImportSDKDemo项目时遇到问题。

我关注这个tutorial,但是缺少信息,例如关于MainActivity.class

当我尝试运行模拟时,我收到以下错误:

java.lang.UnsatisfiedLinkError:找不到byte []的实现dji.midware.natives.SDKRelativeJNI.native_getXXXX(java.lang.String)(尝试过Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX和Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX__Ljava_lang_String_2)

这是整个日志:

09-14 05:04:29.389 3080-3080/? I/m.importsdkdem: Not late-enabling -Xcheck:jni (already on)
09-14 05:04:29.499 3080-3080/? W/m.importsdkdem: Unexpected CPU variant for X86 using defaults: x86
09-14 05:04:30.082 3080-3080/dji.com.importsdkdemo E/sdk: install begin
09-14 05:04:30.086 3080-3080/dji.com.importsdkdemo V/sdk: DexInstall beging
    installSecondarDexs
09-14 05:04:30.086 3080-3080/dji.com.importsdkdemo W/m.importsdkdem: Accessing hidden field Ldalvik/system/BaseDexClassLoader;->pathList:Ldalvik/system/DexPathList; (light greylist, reflection)
    Accessing hidden method Ldalvik/system/DexPathList;->makeInMemoryDexElements([Ljava/nio/ByteBuffer;Ljava/util/List;)[Ldalvik/system/DexPathList$Element; (light greylist, JNI)
09-14 05:04:30.320 3080-3080/dji.com.importsdkdemo W/m.importsdkdem: Accessing hidden field Ldalvik/system/DexPathList;->dexElements:[Ldalvik/system/DexPathList$Element; (light greylist, reflection)
09-14 05:04:30.320 3080-3080/dji.com.importsdkdemo V/sdk: DexInstall end
09-14 05:04:30.376 3080-3098/dji.com.importsdkdemo I/m.importsdkdem: Background concurrent copying GC freed 3588(1814KB) AllocSpace objects, 0(0B) LOS objects, 42% free, 8MB/14MB, paused 12.441ms total 165.671ms
09-14 05:04:30.549 3080-3080/dji.com.importsdkdemo W/m.importsdkdem: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
    Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
09-14 05:04:30.594 3080-3142/dji.com.importsdkdemo E/linker: "/data/app/dji.com.importsdkdemo-jCjys7hOmf0GKv6jezsaUw==/lib/x86/libffmpeg.so" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
09-14 05:04:30.614 3080-3142/dji.com.importsdkdemo W/System.err: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/dji.com.importsdkdemo-jCjys7hOmf0GKv6jezsaUw==/lib/x86/libffmpeg.so" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
        at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
        at java.lang.System.loadLibrary(System.java:1669)
        at dji.midware.natives.SDKRelativeJNI.<clinit>(Unknown Source:2)
        at dji.midware.natives.SDKRelativeJNI.native_getXXXX(Native Method)
        at com.dji.g.a.a.b.a(Unknown Source:24)
        at com.dji.g.a.a.b.a(Unknown Source:5)
        at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source:2)
        at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source:0)
        at dji.com.importsdkdemo.MainActivity$1.run(MainActivity.java:121)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
09-14 05:04:30.615 3080-3142/dji.com.importsdkdemo W/System.err:     at java.lang.Thread.run(Thread.java:764)
09-14 05:04:30.615 3080-3142/dji.com.importsdkdemo D/SDKRelativeJNI: Couldn't load lib
09-14 05:04:30.615 3080-3142/dji.com.importsdkdemo E/m.importsdkdem: No implementation found for byte[] dji.midware.natives.SDKRelativeJNI.native_getXXXX(java.lang.String) (tried Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX and Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX__Ljava_lang_String_2)
09-14 05:04:30.625 3080-3142/dji.com.importsdkdemo E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
    Process: dji.com.importsdkdemo, PID: 3080
    java.lang.UnsatisfiedLinkError: No implementation found for byte[] dji.midware.natives.SDKRelativeJNI.native_getXXXX(java.lang.String) (tried Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX and Java_dji_midware_natives_SDKRelativeJNI_native_1getXXXX__Ljava_lang_String_2)
        at dji.midware.natives.SDKRelativeJNI.native_getXXXX(Native Method)
        at com.dji.g.a.a.b.a(Unknown Source:24)
        at com.dji.g.a.a.b.a(Unknown Source:5)
        at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source:2)
        at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source:0)
        at dji.com.importsdkdemo.MainActivity$1.run(MainActivity.java:121)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
09-14 05:04:30.655 3080-3080/dji.com.importsdkdemo D/OpenGLRenderer: Skia GL Pipeline
09-14 05:04:30.656 3080-3142/dji.com.importsdkdemo I/Process: Sending signal. PID: 3080 SIG: 9

我该如何解决这个问题?

随意询问代码或截图:)

java android sdk dji-sdk
1个回答
3
投票

所以看起来你正在使用4.7.1 SDK并且可能针对现代Android SDK。您遇到的问题是DJI决定捆绑一个版本的libffmpeg.so,它与x86平台上的现代SDK版本不兼容(x86平台就是运行模拟器的版本)。

你有2个,可能有三个选择:

  1. 在Android Studio中,当您创建新的虚拟设备时,当您转到选择系统映像时,请转到其他图像选项卡。从那里选择任何'手臂'图像并使用它。使用此选项时,模拟器将非常慢,如果您的计算机是旧的或慢的,则可能根本不运行。
  2. 在启用调试模式的情况下将真正的Android设备连接到您的计算机并运行该演示。
  3. 在build.gradle文件中,将compileSdkVersion和targetSdkVersion设置为23,这是DJI提供的libffmpeg.so文件将加载的最新版本。这是最糟糕的选择,因为谷歌不允许任何人发布这个低版本的SDK版本的应用程序。该版本现在必须是26或以上:https://support.google.com/googleplay/android-developer/answer/113469#targetsdk
© www.soinside.com 2019 - 2024. All rights reserved.