DJI SDK 4.7.1 crashes unceremoneously where 4.6 does not - android

I'm trying to update my app to use the new 4.7.1 version, but as soon as I try to go to the activity where I'm using UXSDK Widgets, the app now crashes without additional log entries. After updating the SDK version, I made sure that my build.gradle, AndroidManifest.xml and proguard-rules.pro matched up in the relevant areas from the sample code at https://github.com/dji-sdk/Mobile-SDK-Android.
I noticed that across both versions of the SDK I receive very similar logcat errors:
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)
In 4.7.1, there is an additional preceding message that comes immediately before the above block:
E/DJISDKManager: Failed to load license file /storage/emulated/0/DJI/license.dlf (No such file or directory)
Which I assume must have something to do with a new storage mechanism of the license. Later I get:
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)
Despite these errors, in both versions of the SDK, my logs return Returned from registerApp, we got: API Key successfully registered but in 4.7.1 the app simply crashes when I try to access the UXSDK elements after. I do grant storage permissions to the app, so I don't know why it's failing with that license file either.
For reference, my build.gradle lists the following relevant block for the SDK:
// 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'
UPDATE: I attached an Exception handler to the class where the crash happens so I can get a real stack trace. The actual app crash is caused by:
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

I ended up fixing this issue by copying over the contents of the example widget layout.xml (activity_default_widgets.xml) file. The only changes I noticed outside of element ordering between the two versions was:
-custom:excludeItem="aircraftBatteryTemperature|ESCStatus"
+custom:excludeItem="ESCStatus"
and in a couple of places:
-android:visibility="invisible"
+android:visibility="gone"
I have no idea why these changes would have crashed the app with the stack trace from my question update, but only changing this XML file allowed the activity to load again.

Change
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'
to
implementation 'com.dji:dji-uxsdk:4.7.1'
compileOnly 'com.dji:dji-sdk-provided:4.7.1'
implementation 'com.squareup:otto:1.3.8'
The UXSDK depends on SDK and hence the SDK need not be included. Hope that helps!

Related

Failed to instantiate application in jetpack compose

So i'am trying to learn Jetpack Compose, but my Dependency Injection with dagger hilt cannot work properly. But, it is works fine in the other project, so is there something i'am missing here?
FATAL EXCEPTION: main
Process: com.lelestacia.submissioncompose, PID: 6340
java.lang.RuntimeException: Unable to instantiate application com.lelestacia.submissioncompose.application.MyApp package com.lelestacia.submissioncompose: java.lang.ClassNotFoundException: Didn't find class "com.lelestacia.submissioncompose.application.MyApp" on path: DexPathList[[dex file "/data/data/com.lelestacia.submissioncompose/code_cache/.overlay/base.apk/classes3.dex", zip file "/data/app/~~UPDLbuW7-1MIDHePtZAPuw==/com.lelestacia.submissioncompose-VtqvuByd7B1W6Uwl4SYgJA==/base.apk"],nativeLibraryDirectories=[/data/app/~~UPDLbuW7-1MIDHePtZAPuw==/com.lelestacia.submissioncompose-VtqvuByd7B1W6Uwl4SYgJA==/lib/x86_64, /system/lib64, /system_ext/lib64]]
at android.app.LoadedApk.makeApplicationInner(LoadedApk.java:1466)
at android.app.LoadedApk.makeApplicationInner(LoadedApk.java:1395)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6746)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2134)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7898)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.lelestacia.submissioncompose.application.MyApp" on path: DexPathList[[dex file "/data/data/com.lelestacia.submissioncompose/code_cache/.overlay/base.apk/classes3.dex", zip file "/data/app/~~UPDLbuW7-1MIDHePtZAPuw==/com.lelestacia.submissioncompose-VtqvuByd7B1W6Uwl4SYgJA==/base.apk"],nativeLibraryDirectories=[/data/app/~~UPDLbuW7-1MIDHePtZAPuw==/com.lelestacia.submissioncompose-VtqvuByd7B1W6Uwl4SYgJA==/lib/x86_64, /system/lib64, /system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:76)
at androidx.core.app.CoreComponentFactory.instantiateApplication(CoreComponentFactory.java:52)
at android.app.Instrumentation.newApplication(Instrumentation.java:1232)
at android.app.LoadedApk.makeApplicationInner(LoadedApk.java:1458)
at android.app.LoadedApk.makeApplicationInner(LoadedApk.java:1395) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6746) 
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2134) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loopOnce(Looper.java:201) 
at android.os.Looper.loop(Looper.java:288) 
at android.app.ActivityThread.main(ActivityThread.java:7898) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) 
Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/lelestacia/submissioncompose/application/Hilt_MyApp;
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
... 16 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.lelestacia.submissioncompose.application.Hilt_MyApp" on path: DexPathList[[dex file "/data/data/com.lelestacia.submissioncompose/code_cache/.overlay/base.apk/classes3.dex", zip file "/data/app/~~UPDLbuW7-1MIDHePtZAPuw==/com.lelestacia.submissioncompose-VtqvuByd7B1W6Uwl4SYgJA==/base.apk"],nativeLibraryDirectories=[/data/app/~~UPDLbuW7-1MIDHePtZAPuw==/com.lelestacia.submissioncompose-VtqvuByd7B1W6Uwl4SYgJA==/lib/x86_64, /system/lib64, /system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 19 more
And java generated also didn't generate my viewmodel factory, and my app module still marked as unused function even tho it has the icon of consumed from dagger hilt.

AGP 7.2 - java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jacoco/agent/rt/internal_3570298/Offline; for instrumentation tests

When running android instrumentation tests with AGP 7.2 (android studio chipmunk) I am seeing the following error:
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jacoco/agent/rt/internal_b6258fc/Offline;
at androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity.$jacocoInit(Unknown Source:13)
at androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity.<clinit>(Unknown Source:0)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1174)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
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.ClassNotFoundException: Didn't find class "org.jacoco.agent.rt.internal_b6258fc.Offline" on path: DexPathList[[zip file "/system/framework/android.test.mock.jar", zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.abc.appname.develop.test-VAV8qDGNBpOvARX_Y9h_SA==/base.apk"],nativeLibraryDirectories=[/data/app/com.abc.appname.develop.test-VAV8qDGNBpOvARX_Y9h_SA==/lib/x86, /system/lib, /vendor/lib]]
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 androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity.$jacocoInit(Unknown Source:13) 
at androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity.<clinit>(Unknown Source:0) 
at java.lang.Class.newInstance(Native Method) 
at android.app.Instrumentation.newActivity(Instrumentation.java:1174) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
I have jacoco 0.8.8 setup as well, but when I turn debug.testCoverageEnabled to false, the instrumentation tests pass successfully.
Using jacoco 0.8.7 has the same issue, but both 0.8.7 and 0.8.8 work correctly on AGP 7.1.3 (bumblebee).

Firebird and Android JDBC Driver

have problem with Firebird. I have never work with DB. DB on server firebird 1.5.
Add lib: firebird-full-2.2.4 to libs folder
Add this to Gradle: implementation fileTree('libs')
Add this to MainActivity:
Class.forName("org.firebirdsql.jdbc.FBDriver")
val connection = DriverManager.getConnection(
"jdbc:firebirdsql://jdbc:firebirdsql:193.###.###.13/3050:Scool",
"###", "###")
connection.close()
After start I have this:
E/AndroidRuntime: FATAL
EXCEPTION: main
Process: success.kneu, PID: 12219
java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/resource/Referenceable;
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:400)
at java.lang.Class.forName(Class.java:326)
at success.kneu.LoginActivity$onCreate$1.onClick(LoginActivity.kt:48)
at android.view.View.performClick(View.java:5647)
at android.view.View$PerformClick.run(View.java:22465)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6238)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:933)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
Caused by: java.lang.ClassNotFoundException: javax.resource.Referenceable
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:400) 
at java.lang.Class.forName(Class.java:326) 
at success.kneu.LoginActivity$onCreate$1.onClick(LoginActivity.kt:48) 
at android.view.View.performClick(View.java:5647) 
at android.view.View$PerformClick.run(View.java:22465) 
at android.os.Handler.handleCallback(Handler.java:754) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:163) 
at android.app.ActivityThread.main(ActivityThread.java:6238) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:933) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823) 
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/naming/Referenceable;
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:400) 
at java.lang.Class.forName(Class.java:326) 
at success.kneu.LoginActivity$onCreate$1.onClick(LoginActivity.kt:48) 
at android.view.View.performClick(View.java:5647) 
at android.view.View$PerformClick.run(View.java:22465) 
at android.os.Handler.handleCallback(Handler.java:754) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:163) 
at android.app.ActivityThread.main(ActivityThread.java:6238) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:933) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.naming.Referenceable" on path: DexPathList[[zip file
"/data/app/success.kneu-1/base.apk", zip file
"/data/app/success.kneu-1/split_lib_dependencies_apk.apk", zip file
"/data/app/success.kneu-1/split_lib_slice_0_apk.apk", zip file
"/data/app/success.kneu-1/split_lib_slice_1_apk.apk", zip file
"/data/app/success.kneu-1/split_lib_slice_2_apk.apk", zip file
"/data/app/success.kneu-1/split_lib_slice_3_apk.apk", zip file
"/data/app/success.kneu-1/split_lib_slice_4_apk.apk", zip file
"/data/app/success.kneu-1/split_lib_slice_5_apk.apk", zip file
"/data/app/success.kneu-1/split_lib_slice_6_apk.apk", zip file
"/data/app/success.kneu-1/split_lib_slice_7_apk.apk", zip file
"/data/app/success.kneu-1/split_lib_slice_8_apk.apk", zip file
"/data/app/success.kneu-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/success.kneu-1/lib/arm64,
/system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:400) 
at java.lang.Class.forName(Class.java:326) 
at success.kneu.LoginActivity$onCreate$1.onClick(LoginActivity.kt:48) 
at android.view.View.performClick(View.java:5647) 
at android.view.View$PerformClick.run(View.java:22465) 
at android.os.Handler.handleCallback(Handler.java:754) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:163) 
at android.app.ActivityThread.main(ActivityThread.java:6238) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:933) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823) 
2019-07-14 17:37:03.815 12219-12219/? I/Process: Sending signal. PID:
12219 SIG: 9
Jaybird, the Firebird JDBC driver, does not work on Android. There is an Android port of Jaybird, but it is not maintained by the Jaybird team.
The error itself indicates a problem with loading the connector-api because of missing JNDI classes like javax.naming.Referenceable in Android. This would indicate that you are trying to use the normal Jaybird and not the Android port of Jaybird.
Try and replace your Jaybird dependency with one from the Android port.
Be aware though that in general you should not use JDBC drivers to connect to a database from Android. See also JDBC vs Web Service for Android.

FATAL EXCEPTION: java.lang.ClassNotFoundException: Didn't find class "MainAcitivity" on path: DexPathList

I have searched extensively to find a solution for this issue and tried what I see has been suggested in the past.
Things I tried:
Deleted *.iml files locally
Deleted .idea files locally
Removed the project
Closed Android Studio and re-imported
Invalidated cached
Cleaned and re-builded.
I'm assuming what caused the problem is moving MainActivity to a newly created package. Any suggestions would be greatly appreciated.
2019-02-23 17:04:15.948 5842-5842/com.ssowens.android.myweatherapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ssowens.android.myweatherapp, PID: 5842
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ssowens.android.myweatherapp/com.ssowens.android.myweatherapp.ui.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.ssowens.android.myweatherapp.ui.MainActivity" on path: DexPathList[[zip file "/data/app/com.ssowens.android.myweatherapp-UUO7m3VwjvpzPBPoUp-2AA==/base.apk"],nativeLibraryDirectories=[/data/app/com.ssowens.android.myweatherapp-UUO7m3VwjvpzPBPoUp-2AA==/lib/x86, /system/lib, /vendor/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2718)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ssowens.android.myweatherapp.ui.MainActivity" on path: DexPathList[[zip file "/data/app/com.ssowens.android.myweatherapp-UUO7m3VwjvpzPBPoUp-2AA==/base.apk"],nativeLibraryDirectories=[/data/app/com.ssowens.android.myweatherapp-UUO7m3VwjvpzPBPoUp-2AA==/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.Instrumentation.newActivity(Instrumentation.java:1173)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2708)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 
at android.os.Handler.dispatchMessage(Handler.java:105) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6541) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 

java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.IllegalStateException: (app keeps on crashing)

Process: com.example.ucic.startup2, PID: 10917
java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.IllegalStateException: Unable to get package info for com.example.ucic.startup2; is package not installed?
at android.app.LoadedApk.makeApplication(LoadedApk.java:1069)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5842)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalStateException: Unable to get package info for com.example.ucic.startup2; is package not installed?
at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:889)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1057)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5842) 
at android.app.ActivityThread.access$1100(ActivityThread.java:199) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6669) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
2019-01-15 15:32:50.650 1925-1945/? E/NetdConnector: NDC event {613 IfaceClass idle 0 1534431617640} took too long: 670ms
2019-01-15 15:32:54.289 1925-1925/? E/LoadedApk: Unable to instantiate appComponentFactory
java.lang.ClassNotFoundException: Didn't find class "android.support.v4.app.CoreComponentFactory" on path: DexPathList[[],nativeLibraryDirectories=[/system/priv-app/GoogleSdkSetup/lib/x86, /system/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.LoadedApk.createAppFactory(LoadedApk.java:226)
at android.app.LoadedApk.updateApplicationInfo(LoadedApk.java:338)
at android.app.ActivityThread.handleDispatchPackageBroadcast(ActivityThread.java:5388)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1733)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at com.android.server.SystemServer.run(SystemServer.java:454)
at com.android.server.SystemServer.main(SystemServer.java:294)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:838)
2019-01-15 15:32:54.321 1925-1925/? E/LoadedApk: Unable to instantiate appComponentFactory
java.lang.ClassNotFoundException: Didn't find class "android.support.v4.app.CoreComponentFactory" on path: DexPathList[[],nativeLibraryDirectories=[/system/priv-app/GoogleSdkSetup/lib/x86, /system/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.LoadedApk.createAppFactory(LoadedApk.java:226)
at android.app.LoadedApk.updateApplicationInfo(LoadedApk.java:338)
at android.app.ActivityThread.handleDispatchPackageBroadcast(ActivityThread.java:5388)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1733)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at com.android.server.SystemServer.run(SystemServer.java:454)
at com.android.server.SystemServer.main(SystemServer.java:294)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:838)
2019-01-15 15:33:11.647 1925-1939/? E/ActivityManager: Aborting stack trace dump (current extra pid=9860); deadline exceeded.
2019-01-15 15:33:11.685 1925-1939/? E/ActivityManager: ANR in com.android.systemui

Categories

Resources