dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
994 stars 581 forks source link

最近经常出现这个bug java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String dji.midware #709

Open SJJ-dot opened 3 years ago

SJJ-dot commented 3 years ago
java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString() (tried Java_dji_midware_natives_SDKRelativeJNI_native_1getUsbAccessoryAttachedString and Java_dji_midware_natives_SDKRelativeJNI_native_1getUsbAccessoryAttachedString__)
        at dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString(Native Method)
        at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source:32)
        at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source:0)

我的配置

multiDexEnabled true

  dexOptions {
        incremental true
        javaMaxHeapSize "4g"
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    packagingOptions {
        doNotStrip "*/*/libdjivideo.so"
        doNotStrip "*/*/libSDKRelativeJNI.so"
        doNotStrip "*/*/libFlyForbid.so"
        doNotStrip "*/*/libduml_vision_bokeh.so"
        doNotStrip "*/*/libyuv2.so"
        doNotStrip "*/*/libGroudStation.so"
        doNotStrip "*/*/libFRCorkscrew.so"
        doNotStrip "*/*/libUpgradeVerify.so"
        doNotStrip "*/*/libFR.so"
        doNotStrip "*/*/libDJIFlySafeCore.so"
        doNotStrip "*/*/libdjifs_jni.so"
        doNotStrip "*/*/libsfjni.so"
        doNotStrip "*/*/libDJICommonJNI.so"
        doNotStrip "*/*/libDJICSDKCommon.so"
        doNotStrip "*/*/libDJIUpgradeCore.so"
        doNotStrip "*/*/libDJIUpgradeJNI.so"
        doNotStrip "*/*/libDJIWaypointV2Core.so"
        doNotStrip "*/*/libAMapSDK_MAP_v6_9_2.so"
        doNotStrip "*/*/libDJIMOP.so"
        doNotStrip "*/*/libDJISDKLOGJNI.so"

        pickFirst 'lib/*/libstlport_shared.so'
        pickFirst 'lib/*/libRoadLineRebuildAPI.so'
        pickFirst 'lib/*/libGNaviUtils.so'
        pickFirst 'lib/*/libGNaviMapex.so'
        pickFirst 'lib/*/libGNaviData.so'
        pickFirst 'lib/*/libGNaviMap.so'
        pickFirst 'lib/*/libGNaviSearch.so'
        pickFirst 'lib/*/libDJIFlySafeCore.so'
        pickFirst 'lib/*/libdjifs_jni.so'
        pickFirst 'lib/*/libsfjni.so'
        exclude 'META-INF/proguard/okhttp3.pro'
        exclude 'META-INF/rxjava.properties'
        exclude 'assets/location_map_gps_locked.png'
        exclude 'assets/location_map_gps_3d.png'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/*.publicsuffixes.gz'
    }
api('com.dji:dji-uxsdk:4.13', {
        /**
         * Uncomment the "library-anti-distortion" if your app does not need Anti Distortion for Mavic 2 Pro and Mavic 2 Zoom.
         * Uncomment the "fly-safe-database" if you need database for release, or we will download it when DJISDKManager.getInstance().registerApp
         * is called.
         * Both will greatly reducing the size of the APK.
         */
        exclude module: 'library-anti-distortion'
        exclude module: 'fly-safe-database'

        /**
         * Uncomment the following line to exclude amap from the app.
         * Note that Google Play Store does not allow APKs that include this library.
         */
        exclude group: 'com.amap.api'
        exclude group: 'com.google.android.gms'
    })
    api("com.dji:dji-sdk:${rootProject.ext.version.djiSdkVersion}")
    compileOnly("com.dji:dji-sdk-provided:${rootProject.ext.version.djiSdkVersion}")
dji-dev commented 3 years ago

Agent comment from William Wong in Zendesk ticket #42196:

尊敬的开发者, 您好,感谢您联系DJI 大疆创新。

我对比了一下你的build.gradle和Sample的,没什么区别。能不能跑跑Sample,我确定Sample不会报这样的错误,你是做了什么操作会导致这样的异常抛出呢?

希望我们的解决方案能够帮到您,感谢您的邮件,祝您生活愉快! Best Regards, DJI 大疆创新SDK技术支持

SJJ-dot commented 3 years ago

Agent comment from William Wong in Zendesk ticket #42196:

尊敬的开发者, 您好,感谢您联系DJI 大疆创新。

我对比了一下你的build.gradle和Sample的,没什么区别。能不能跑跑Sample,我确定Sample不会报这样的错误,你是做了什么操作会导致这样的异常抛出呢?

希望我们的解决方案能够帮到您,感谢您的邮件,祝您生活愉快! Best Regards, DJI 大疆创新SDK技术支持

abiFilters 'armeabi-v7a',  'arm64-v8a'  增加了 'x86' 之后似乎就没有崩溃了。
SJJ-dot commented 3 years ago

我感觉很费解啊。。。安装包体积太大了能不能优化下。给我一个只要一个abi架构的选项

SJJ-dot commented 3 years ago

并没有解决:::::::

java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString() (tried Java_dji_midware_natives_SDKRelativeJNI_native_1getUsbAccessoryAttachedString and Java_dji_midware_natives_SDKRelativeJNI_native_1getUsbAccessoryAttachedString__)
dji-dev commented 3 years ago

Agent comment from William Wong in Zendesk ticket #42196:

尊敬的开发者, 您好,感谢您联系DJI 大疆创新。

优化只能在build.gradle里面exclude模块,没有其他的办法。崩溃问题你说加X86能解决,你的手机CPU是X86架构的嘛?

希望我们的解决方案能够帮到您,感谢您的邮件,祝您生活愉快! Best Regards, DJI 大疆创新SDK技术支持


inline1637668438.png

SJJ-dot commented 3 years ago

没有解决,今天又这样子了。用as安装启动经常报java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString() (tried Java_dji_midware_natives_SDKRelativeJNI_native_1getUsbAccessoryAttachedString and Java_dji_midware_natives_SDKRelativeJNI_native_1getUsbAccessoryAttachedString__)        at dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString(Native Method)         at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source:32)         at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source:0)

。手动点击桌面图标没有这个问题

------------------ 原始邮件 ------------------ 发件人: "DJI"<notifications@github.com>; 发送时间: 2020年12月22日(星期二) 下午5:00 收件人: "dji-sdk/Mobile-SDK-Android"<Mobile-SDK-Android@noreply.github.com>; 抄送: "978622005"<978622005@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [dji-sdk/Mobile-SDK-Android] 最近经常出现这个bug java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String dji.midware (#709)

Agent comment from William Wong in Zendesk ticket #42196:

尊敬的开发者, 您好,感谢您联系DJI 大疆创新。

优化只能在build.gradle里面exclude模块,没有其他的办法。崩溃问题你说加X86能解决,你的手机CPU是X86架构的嘛?

希望我们的解决方案能够帮到您,感谢您的邮件,祝您生活愉快! Best Regards, DJI 大疆创新SDK技术支持

​ inline1637668438.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Wei-Han1108 commented 1 year ago

@SJJ-dot 你怎么解决的呢,我跑sample没有这个问题,但是在import到自己的项目会有