gpt4 book ai didi

android - DJI SDK 4.7.1 在 4.6 没有的情况下毫不客气地崩溃

转载 作者:搜寻专家 更新时间:2023-11-01 08:20:11 25 4
gpt4 key购买 nike

我正在尝试更新我的应用程序以使用新的 4.7.1 版本,但是当我尝试转到我正在使用 UXSDK Widgets 的 Activity 时,应用程序现在崩溃了,没有额外的日志条目。更新 SDK 版本后,我确保我的 build.gradle、AndroidManifest.xml 和 proguard-rules.pro 在 https://github.com/dji-sdk/Mobile-SDK-Android 的示例代码中的相关区域匹配。 .

我注意到在两个版本的 SDK 中我收到非常相似的 logcat 错误:

E/DJISDKManager: can't find DJIEventBusIndex Class in SharedLib module
E/DJISDKManager: java.lang.ClassNotFoundException: dji.event3.sharelib.DJIEventBusIndex
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:43)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:95)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.event3.sharelib.DJIEventBusIndex" on path: DexPathList[[zip file "/data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/base.apk", zip file "/data/user/0/com.reportall.droneglide.fence/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/lib/arm64, /data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:453) 
at java.lang.Class.forName(Class.java:378) 
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:43) 
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0) 
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:95) 
at java.lang.Thread.run(Thread.java:764) 
E/DJISDKManager: can't find DJIEventBusIndex Class in MidWare module
E/DJISDKManager: java.lang.ClassNotFoundException: dji.event3.midware.DJIEventBusIndex
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:62)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:95)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.event3.midware.DJIEventBusIndex" on path: DexPathList[[zip file "/data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/base.apk", zip file "/data/user/0/com.reportall.droneglide.fence/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/lib/arm64, /data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:453) 
at java.lang.Class.forName(Class.java:378) 
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:62) 
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0) 
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:95) 
at java.lang.Thread.run(Thread.java:764) 
E/DJISDKManager: can't find DJIEventBusIndex Class in FlyForbid module
E/DJISDKManager: java.lang.ClassNotFoundException: dji.event3.flyforbid.DJIEventBusIndex
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:81)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:95)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.event3.flyforbid.DJIEventBusIndex" on path: DexPathList[[zip file "/data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/base.apk", zip file "/data/user/0/com.reportall.droneglide.fence/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/lib/arm64, /data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:453) 
at java.lang.Class.forName(Class.java:378) 
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:81) 
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0) 
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:95) 
at java.lang.Thread.run(Thread.java:764) 
E/DJISDKManager: can't find DJIEventBusIndex Class in service module
E/DJISDKManager: java.lang.ClassNotFoundException: dji.event3.service.DJIEventBusIndex
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:100)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:95)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.event3.service.DJIEventBusIndex" on path: DexPathList[[zip file "/data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/base.apk", zip file "/data/user/0/com.reportall.droneglide.fence/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/lib/arm64, /data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:453) 
at java.lang.Class.forName(Class.java:378) 
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:100) 
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0) 
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:95) 
at java.lang.Thread.run(Thread.java:764) 
can't find DJIEventBusIndex Class in FrLib module
E/DJISDKManager: java.lang.ClassNotFoundException: com.dji.frlib.DJIEventBusIndex
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:119)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:95)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.dji.frlib.DJIEventBusIndex" on path: DexPathList[[zip file "/data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/base.apk", zip file "/data/user/0/com.reportall.droneglide.fence/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/lib/arm64, /data/app/com.reportall.droneglide.fence-OGmqnjtacp7079L76urIHA==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:453) 
at java.lang.Class.forName(Class.java:378) 
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:119) 
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0) 
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:95) 
at java.lang.Thread.run(Thread.java:764)

在 4.7.1 中,在上述 block 之前还有一条额外的前置消息:

E/DJISDKManager: Failed to load license file /storage/emulated/0/DJI/license.dlf (No such file or directory)

我认为这一定与许可证的新存储机制有关。后来我得到:

W/System.err: java.util.concurrent.TimeoutException
at dji.midware.util.t.a(Unknown Source:40)
at dji.midware.broadcastReceivers.DJINetWorkReceiver.b(Unknown Source:30)
W/System.err: at dji.midware.broadcastReceivers.DJINetWorkReceiver.f(Unknown Source:88)
at dji.midware.broadcastReceivers.DJINetWorkReceiver.<init>(Unknown Source:10)
at dji.sdk.sdkmanager.DJISDKManager.initParams(Unknown Source:189)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:146)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:95)
at java.lang.Thread.run(Thread.java:764)

尽管有这些错误,在两个版本的 SDK 中,我的日志都返回 Returned from registerApp, we got: API Key successful registered 但在 4.7.1 中,当我尝试访问UXSDK 元素之后。我确实向该应用程序授予了存储权限,所以我也不知道为什么该许可证文件会失败。

作为引用,我的 build.gradle 列出了 SDK 的以下相关 block :

// DJI SDK
implementation 'com.dji:dji-sdk:4.7.1'
implementation 'com.dji:dji-uxsdk:4.7.1'
compileOnly 'com.dji:dji-sdk-provided:4.7.1'
implementation 'com.squareup:otto:1.3.8'

更新:我将一个异常处理程序附加到发生崩溃的类,这样我就可以获得真正的堆栈跟踪。实际的应用程序崩溃是由以下原因引起的:

E/ExceptionHandler: java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling.
at dji.thirdparty.rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:60)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: dji.thirdparty.rx.exceptions.OnErrorNotImplementedException: Attempt to invoke virtual method 'void dji.ux.model.c.b(java.lang.String)' on a null object reference
at dji.thirdparty.rx.Observable$26.onError(Observable.java:8524)
at dji.thirdparty.rx.observers.SafeSubscriber._onError(SafeSubscriber.java:157)
at dji.thirdparty.rx.observers.SafeSubscriber.onError(SafeSubscriber.java:120)
at dji.thirdparty.rx.observers.SerializedObserver.onError(SerializedObserver.java:158)
at dji.thirdparty.rx.observers.SerializedSubscriber.onError(SerializedSubscriber.java:79)
at dji.thirdparty.rx.internal.operators.OnSubscribeConcatMap$ConcatMapSubscriber.innerError(OnSubscribeConcatMap.java:192)
at dji.thirdparty.rx.internal.operators.OnSubscribeConcatMap$ConcatMapInnerSubscriber.onError(OnSubscribeConcatMap.java:340)
at dji.thirdparty.rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.checkTerminated(OperatorObserveOn.java:264)
at dji.thirdparty.rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:207)
at dji.thirdparty.rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void dji.ux.model.c.b(java.lang.String)' on a null object reference
at dji.ux.panel.PreFlightCheckListPanel.addItemsOnDisconnect(Unknown Source:152)
at dji.ux.panel.PreFlightCheckListPanel.transformValue(Unknown Source:245)
at dji.ux.base.SimpleFrameLayoutWidget$1.a(Unknown Source:6)
at dji.ux.base.SimpleFrameLayoutWidget$1.call(Unknown Source:2)
at dji.thirdparty.rx.internal.util.ScalarSynchronousObservable$4.call(ScalarSynchronousObservable.java:223)
at dji.thirdparty.rx.internal.util.ScalarSynchronousObservable$4.call(ScalarSynchronousObservable.java:220)
at dji.thirdparty.rx.Observable$2.call(Observable.java:233)
at dji.thirdparty.rx.Observable$2.call(Observable.java:225)
at dji.thirdparty.rx.Observable.unsafeSubscribe(Observable.java:8741)
at dji.thirdparty.rx.internal.operators.OnSubscribeConcatMap$ConcatMapSubscriber.drain(OnSubscribeConcatMap.java:286)
at dji.thirdparty.rx.internal.operators.OnSubscribeConcatMap$ConcatMapSubscriber.onNext(OnSubscribeConcatMap.java:144)
at dji.thirdparty.rx.internal.operators.OnSubscribeFromArray$FromArrayProducer.slowPath(OnSubscribeFromArray.java:100)
at dji.thirdparty.rx.internal.operators.OnSubscribeFromArray$FromArrayProducer.request(OnSubscribeFromArray.java:63)
at dji.thirdparty.rx.Subscriber.setProducer(Subscriber.java:211)
at dji.thirdparty.rx.internal.operators.OnSubscribeFromArray.call(OnSubscribeFromArray.java:32)
at dji.thirdparty.rx.internal.operators.OnSubscribeFromArray.call(OnSubscribeFromArray.java:24)
at dji.thirdparty.rx.Observable.unsafeSubscribe(Observable.java:8741)
at dji.thirdparty.rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:94)
at dji.thirdparty.rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:42)
at dji.thirdparty.rx.Observable.subscribe(Observable.java:8834)
at dji.thirdparty.rx.Observable.subscribe(Observable.java:8801)
at dji.thirdparty.rx.Observable.subscribe(Observable.java:8515)
at dji.ux.c.h$3$1.onSuccess(Unknown Source:34)
at dji.keysdk.KeyManager$1.onSuccess(Unknown Source:14)
at dji.sdksharedlib.DJISDKCache.getValue(Unknown Source:14)
at dji.keysdk.KeyManager.getValue(Unknown Source:18)
at dji.ux.c.h$3.a

最佳答案

我最终通过复制示例小部件 layout.xml (activity_default_widgets.xml) 文件的内容解决了这个问题。除了两个版本之间的元素顺序外,我注意到的唯一变化是:

-custom:excludeItem="aircraftBatteryTemperature|ESCStatus"
+custom:excludeItem="ESCStatus"

还有几个地方:

-android:visibility="invisible"
+android:visibility="gone"

我不知道为什么这些更改会使用我的问题更新中的堆栈跟踪使应用程序崩溃,但只有更改此 XML 文件才能让 Activity 再次加载。

关于android - DJI SDK 4.7.1 在 4.6 没有的情况下毫不客气地崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52315949/

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