After changing version to Androidx and can not connect to mqtt server.
It worked well in other versions than Androidx.
Is this a version problem?
My source code and build information is on the link-> I added it when I made the project. AndroidX Artifact has not been mqt communication since then. What is the problem?
My error Logs↓
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.adfdffffaaaaaaa, PID: 28371
java.lang.NoClassDefFoundError: Failed resolution of:
Landroidx/localbroadcastmanager/content/LocalBroadcastManager;
at
org.eclipse.paho.android.service.MqttAndroidClient.registerReceiver(MqttAndroidClient.java:450)
at org.eclipse.paho.android.service.MqttAndroidClient.connect(MqttAndroidClient.java:428)
at org.eclipse.paho.android.service.MqttAndroidClient.connect(MqttAndroidClient.java:358)
at org.eclipse.paho.android.service.MqttAndroidClient.connect(MqttAndroidClient.java:313)
at com.example.adfdffffaaaaaaa.MqttKt.connect(Mqtt.kt:15)
at com.example.adfdffffaaaaaaa.MainActivity.onCreate(MainActivity.kt:12)
at android.app.Activity.performCreate(Activity.java:7159)
at android.app.Activity.performCreate(Activity.java:7150)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3001)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3156)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at
android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1864)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:205)
at android.app.ActivityThread.main(ActivityThread.java:6993)
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:884)
Caused by: java.lang.ClassNotFoundException: Didn't find class
"androidx.localbroadcastmanager.content.LocalBroadcastManager" on path: DexPathList[[zip file
"/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/base.apk", zip file
"/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/split_lib_dependencies_apk.apk", zip
file "/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/split_lib_resources_apk.apk",
zip file "/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/split_lib_slice_0_apk.apk",
zip file "/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/split_lib_slice_1_apk.apk",
zip file "/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/split_lib_slice_2_apk.apk",
zip file "/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/split_lib_slice_3_apk.apk",
zip file "/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/split_lib_slice_4_apk.apk",
zip file "/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/split_lib_slice_5_apk.apk",
zip file "/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/split_lib_slice_6_apk.apk",
zip file "/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/split_lib_slice_7_apk.apk",
zip file "/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/split_lib_slice_8_apk.apk",
zip file "/data/app/com.example.adfdffffaaaaaaa-
anRxYlYVlgY0rXwazlHcYg==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=
[/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/lib/arm64, /system/lib64,
/system/product/lib64, /system/vendor/lib64]]
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
org.eclipse.paho.android.service.MqttAndroidClient.registerReceiver(MqttAndroidClient.java:450)
at org.eclipse.paho.android.service.MqttAndroidClient.connect(MqttAndroidClient.java:428)
at org.eclipse.paho.android.service.MqttAndroidClient.connect(MqttAndroidClient.java:358)
at org.eclipse.paho.android.service.MqttAndroidClient.connect(MqttAndroidClient.java:313)
at com.example.adfdffffaaaaaaa.MqttKt.connect(Mqtt.kt:15)
at com.example.adfdffffaaaaaaa.MainActivity.onCreate(MainActivity.kt:12)
at android.app.Activity.performCreate(Activity.java:7159)
at android.app.Activity.performCreate(Activity.java:7150)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3001)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3156)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at
android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1864)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:205)
at android.app.ActivityThread.main(ActivityThread.java:6993)
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:884)
Suppressed: java.io.IOException: No original dex files found for dex location
/data/app/com.example.adfdffffaaaaaaa-anRxYlYVlgY0rXwazlHcYg==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.<init>(DexFile.java:101)
at dalvik.system.DexFile.<init>(DexFile.java:75)
E/AndroidRuntime: at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:733)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:816)
at android.app.LoadedApk.getResources(LoadedApk.java:1038)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2391)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6040)
at android.app.ActivityThread.access$1100(ActivityThread.java:208)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
... 6 more
Try setting android.enableJetifier=true in gradle.properties file. If that doesn't work, try adding implementation 'androidx.legacy:legacy-support-v4:1.0.0' to build.grade.
This problem has been solved before in the next links, I highly recommend checking them out, specially 420:
https://github.com/eclipse/paho.mqtt.android/issues/321
https://github.com/eclipse/paho.mqtt.android/issues/420
I had the same problem.
I solved it. my solution:
Add this dependency to the build.gradle(:app)
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
Use these implementations for paho mqtt in the build.gradle(:app)
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
Add these permissions to the manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
add this line to gradle.properties
android.enableJetifier=true
It worked for me. I hope works for you too.
Related
I have an android app with Facebook login implemented. It has been working perfect for the last year, but today I started my app and got an error on this line:
final LoginButton loginButton = (LoginButton) findViewById(R.id.facebook_login_button);
loginButton.setReadPermissions(Arrays.asList("public_profile,email"));
Error
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.application.GlassFrogg, PID: 28151
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/facebook/internal/LoginAuthorizationType;
at com.facebook.login.widget.LoginButton$LoginButtonProperties.setReadPermissions(LoginButton.java:149)
at com.facebook.login.widget.LoginButton.setReadPermissions(LoginButton.java:276)
at com.application.GlassFrogg.LoginScreen.onCreate(LoginScreen.java:184)
at android.app.Activity.performCreate(Activity.java:7326)
at android.app.Activity.performCreate(Activity.java:7317)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3066)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3229)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1926)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6981)
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:1445)
E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.internal.LoginAuthorizationType" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/base.apk", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_dependencies_apk.apk", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_resources_apk.apk", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_0_apk.apk", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_1_apk.apk", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_2_apk.apk", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_3_apk.apk", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_4_apk.apk", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_5_apk.apk", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_6_apk.apk", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_7_apk.apk", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_8_apk.apk", zip file "/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/lib/arm64, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/base.apk!/lib/arm64-v8a, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_resources_apk.apk!/lib/arm64-v8a, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_6_apk.apk!/lib/arm64-v8a, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_7_apk.apk!/lib/arm64-v8a, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_8_apk.apk!/lib/arm64-v8a, /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_slice_9_apk.apk!/lib/arm64-v8a, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 18 more
Suppressed: java.io.IOException: No original dex files found for dex location (arm64) /data/app/com.application.GlassFrogg-9iEMWqfIsuzThI_-Q3q51w==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.<init>(DexFile.java:101)
at dalvik.system.DexFile.<init>(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
E/AndroidRuntime: at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:764)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:847)
at android.app.LoadedApk.getResources(LoadedApk.java:1088)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2563)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6031)
at android.app.ActivityThread.access$1200(ActivityThread.java:235)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1768)
... 6 more
For some reason I am getting three errors when the app crashes. A google search for the exact error code gave me 0 results (that was a first).
I have tried to change what read permissions I request do no avail. I checked to see if methods have been depreciated in the recent facebook API updated, but I don't think that is the issue either.
I solved this by updating to the latest version of the Facebook API. Some of the function calls changed slightly in the update which was causing the crash.
I have following following error which will cause my android app to jump out, where it jumps out is very inconsistent i can't pin point the code causing it. Anyone can read and understand what it is?
E/AndroidRuntime: FATAL EXCEPTION: Thread-22
Process: my.zen.com.uselessapp.xxxxxxxx, PID: 16384
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion;
at com.google.android.gms.internal.ads.zzaj.zzb(Unknown Source:3)
at com.google.android.gms.internal.ads.zzai.zza(Unknown Source:4)
at com.google.android.gms.internal.ads.zzak.zzc(Unknown Source:32)
at com.google.android.gms.internal.ads.zzayl.zzc(Unknown Source:27)
at com.google.android.gms.internal.ads.zzn.processRequest(Unknown Source:28)
at com.google.android.gms.internal.ads.zzn.run(Unknown Source:12)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/base.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_dependencies_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_resources_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_0_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_1_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_2_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_3_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_4_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_5_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_6_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_7_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_8_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/lib/arm64, /system/lib64]]
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 com.google.android.gms.internal.ads.zzaj.zzb(Unknown Source:3)
at com.google.android.gms.internal.ads.zzai.zza(Unknown Source:4)
at com.google.android.gms.internal.ads.zzak.zzc(Unknown Source:32)
at com.google.android.gms.internal.ads.zzayl.zzc(Unknown Source:27)
at com.google.android.gms.internal.ads.zzn.processRequest(Unknown Source:28)
at com.google.android.gms.internal.ads.zzn.run(Unknown Source:12)
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.<init>(DexFile.java:101)
at dalvik.system.DexFile.<init>(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:727)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:810)
at android.app.LoadedApk.getResources(LoadedApk.java:1032)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2345)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5798)
at android.app.ActivityThread.access$1100(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6718)
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)
Application terminated.
Add this in you AndroidMenifest.xml inside <application> tag
<application
android:theme="#style/AppTheme">
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
</application>
You are getting a NoClassDefError
java.lang.NoClassDefFoundError: Failed resolution of:
Lorg/apache/http/ProtocolVersion;
caused by
java.lang.ClassNotFoundException:
because the Dalvik executable (Dex) class loader couldn't find a particular class for run time
:
Didn't find class: "org.apache.http.ProtocolVersion"
when it tries to run your app
on path: DexPathList[[zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/base.apk",
That is basically what it means. So check where this class could be used, I suspect one of your dependencies, and make sure everything is in order there, then try building again.
My app was working fine until I added kotlin coroutines as instructed here . When I click a floating button to open another activity from this lib I get this error. With coroutines removed app works fine.
I have already tried a number of solutions such as:
Disabling instant run.
Clean and Rebuild
Adding minifyEnabled false to debug buildType.
Adding multiDex
But none worked.
android {
compileSdkVersion 28
defaultConfig {
...
minSdkVersion 17
targetSdkVersion 28
multiDexEnabled true
...
}
}
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1'
implementation "org.jetbrains.anko:anko:$anko_version"
implementation "org.jetbrains.anko:anko-design:$anko_version"
implementation 'com.fxn769:pix:1.2.5'
implementation 'com.android.support:multidex:1.0.3'
....
}
Traces
2019-02-18 10:01:10.097 9523-9523/com.APPIDHERE E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.APPIDHERE, PID: 9523
java.lang.NoClassDefFoundError: Failed resolution of: Lkotlinx/coroutines/experimental/CompletableDeferredKt;
at io.fotoapparat.hardware.CameraDevice.<init>(CameraDevice.kt:48)
at io.fotoapparat.hardware.Device.<init>(Device.kt:39)
at io.fotoapparat.hardware.Device.<init>(Device.kt:34)
at io.fotoapparat.Fotoapparat.<init>(Fotoapparat.kt:55)
at io.fotoapparat.Fotoapparat.<init>(Fotoapparat.kt:48)
at io.fotoapparat.FotoapparatBuilder.buildInternal(FotoapparatBuilder.kt:190)
at io.fotoapparat.FotoapparatBuilder.build(FotoapparatBuilder.kt:179)
at com.fxn.pix.Pix.initialize(Pix.java:373)
at com.fxn.pix.Pix.onCreate(Pix.java:325)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
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.ClassNotFoundException: Didn't find class "kotlinx.coroutines.experimental.CompletableDeferredKt" on path: DexPathList[[zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/base.apk", zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_dependencies_apk.apk", zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_resources_apk.apk", zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_slice_0_apk.apk", zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_slice_1_apk.apk", zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_slice_2_apk.apk", zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_slice_3_apk.apk", zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_slice_4_apk.apk", zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_slice_5_apk.apk", zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_slice_6_apk.apk", zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_slice_7_apk.apk", zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_slice_8_apk.apk", zip file "/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/lib/x86, /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 io.fotoapparat.hardware.CameraDevice.<init>(CameraDevice.kt:48)
at io.fotoapparat.hardware.Device.<init>(Device.kt:39)
at io.fotoapparat.hardware.Device.<init>(Device.kt:34)
at io.fotoapparat.Fotoapparat.<init>(Fotoapparat.kt:55)
at io.fotoapparat.Fotoapparat.<init>(Fotoapparat.kt:48)
at io.fotoapparat.FotoapparatBuilder.buildInternal(FotoapparatBuilder.kt:190)
at io.fotoapparat.FotoapparatBuilder.build(FotoapparatBuilder.kt:179)
at com.fxn.pix.Pix.initialize(Pix.java:373)
at com.fxn.pix.Pix.onCreate(Pix.java:325)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
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)
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.APPIDHERE-EfujhYqtoKYpsUMLZOt1TQ==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.<init>(DexFile.java:101)
at dalvik.system.DexFile.<init>(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
2019-02-18 10:01:10.097 9523-9523/com.APPIDHERE E/AndroidRuntime: at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:727)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:810)
at android.app.LoadedApk.getResources(LoadedApk.java:1032)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2345)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5749)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
... 6 more
The experimental coroutines are used in an old version of the Fotoapparat that PixImagePicker depends on. See here
Though Fotoapparat has updated so it's not using these anymore, and PixImagePicker seems to be using the latest version of Fotoapparat too.
Maybe raise issues with them on Github.
Fotoapparat
PixImagePicker
Today I tried to initialize "ChatSDK" and had a few problems. Now, if I want to start my app it is crashing all time. I found this problem:
E/androidRuntime: FATAL EXEPTION: main Process: com.inspredunity.gm.germanminelife, PID: 2605
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.inspredunity.gm.germanminelife/com.inspredunity.gm.germanminelife.MainActivity}: android.view.InflateException: Binary XML file line #20: Binary XML file line #20: Error inflating class android.support.design.widget.FloatingActionButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
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: android.view.InflateException: Binary XML file line #20: Binary XML file line #20: Error inflating class android.support.design.widget.FloatingActionButton
Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class android.support.design.widget.FloatingActionButton
E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.FloatingActionButton" on path: DexPathList[[zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/base.apk", zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_dependencies_apk.apk", zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_resources_apk.apk", zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_0_apk.apk", zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_1_apk.apk", zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_2_apk.apk", zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_3_apk.apk", zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_4_apk.apk", zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_5_apk.apk", zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_6_apk.apk", zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_7_apk.apk", zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_8_apk.apk", zip file "/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/base.apk!/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_dependencies_apk.apk!/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_resources_apk.apk!/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_0_apk.apk!/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_1_apk.apk!/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_2_apk.apk!/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_3_apk.apk!/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_4_apk.apk!/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_5_apk.apk!/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_6_apk.apk!/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_7_apk.apk!/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_8_apk.apk!/lib/x86, /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_slice_9_apk.apk!/lib/x86, /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.view.LayoutInflater.createView(LayoutInflater.java:606)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
E/AndroidRuntime: at com.inspredunity.gm.germanminelife.MainActivity.onCreate(MainActivity.java:37)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
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)
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.inspredunity.gm.germanminelife-EdgnsjPOMDBCjzzyKZd6KA==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.<init>(DexFile.java:101)
at dalvik.system.DexFile.<init>(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:727)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:810)
at android.app.LoadedApk.getResources(LoadedApk.java:1032)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2345)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5749)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
Here are my Gradle dependencies:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplemenstation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.4'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.android.support:design:28.0.0'
implementation 'co.chatsdk.chatsdk:chat-sdk-core:4.4.8'
implementation 'co.chatsdk.chatsdk:chat-sdk-ui:4.4.8'
implementation 'co.chatsdk.chatsdk:chat-sdk-firebase-adapter:4.4.8'
implementation 'co.chatsdk.chatsdk:chat-sdk-firebase-file-storage:4.4.8'
implementation 'com.android.support:recyclerview-v7:28.0.0'
I tired every fix suggestion which I found at the internet but nothing worked. I hope you guys can help me.
If you need my MainActivity or my gradle file(s) please say it!
Thank you in advance!
FIXED
For any person still having this problem after febuary 2019, if you are using androidx or the new material libraries, This problem is happening because Google changed the naming format of the libraries using androidx.. you can check this official mapping https://developer.android.com/jetpack/androidx/migrate/artifact-mappings
and search for your library to see what the new name is, now that Google is in androidx
In your case, your library "android.support.design.widget.FloatingActionButton" in your xml file, is now called as using com.google.android.material.floatingactionbutton.FloatingActionButton
Android Support Library is no longer maintained. It is therefore recommended to use AndroidX Library instead.
FloatingActionButton using AndroidX:
1. Add in gradle:
implementation 'com.google.android.material:material:1.1.0'
2. Add in your layout:
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:src="#drawable/share_button"
android:layout_margin="16dp" />
Did you add android support library to your project? If not try this one :
implementation "com.android.support:design:28.0.0"
For more details about how to setup support library, you can check this
https://developer.android.com/topic/libraries/support-library/setup
Add this into your gradle :
implementation com.android.support:design:28.0.0
After updating my phone to Android 9, and updating the sdk version to 4.8.1, i am having an issue while trying to register the sdk:
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/params/BasicHttpParams;
at dji.thirdparty.afinal.FinalHttp.<init>(Unknown Source:12)
at com.dji.frame.util.V_AppUtils.b(Unknown Source:9)
at dji.internal.version.b.a(Unknown Source:43)
at dji.internal.version.d.a(Unknown Source:8)
at dji.internal.version.VersionController.a(Unknown Source:12)
at dji.sdk.sdkmanager.DJISDKManager.initParams(Unknown Source:49)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:129)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:104)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.params.BasicHttpParams" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/base.apk", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_dependencies_apk.apk", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_resources_apk.apk", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_0_apk.apk", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_1_apk.apk", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_2_apk.apk", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_3_apk.apk", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_4_apk.apk", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_5_apk.apk", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_6_apk.apk", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_7_apk.apk", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_8_apk.apk", zip file "/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_9_apk.apk", dex file "InMemoryDexFile[cookie=[0, 505806403584]]", dex file "InMemoryDexFile[cookie=[0, 505806404160]]"],nativeLibraryDirectories=[/data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/lib/arm64, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/base.apk!/lib/arm64-v8a, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_resources_apk.apk!/lib/arm64-v8a, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_6_apk.apk!/lib/arm64-v8a, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_7_apk.apk!/lib/arm64-v8a, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_8_apk.apk!/lib/arm64-v8a, /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_slice_9_apk.apk!/lib/arm64-v8a, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:169)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at dji.thirdparty.afinal.FinalHttp.<init>(Unknown Source:12)
at com.dji.frame.util.V_AppUtils.b(Unknown Source:9)
at dji.internal.version.b.a(Unknown Source:43)
at dji.internal.version.d.a(Unknown Source:8)
at dji.internal.version.VersionController.a(Unknown Source:12)
at dji.sdk.sdkmanager.DJISDKManager.initParams(Unknown Source:49)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:129)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:104)
at java.lang.Thread.run(Thread.java:764)
2019-01-10 12:02:39.820 8784-8840/com.paragon.defenders E/AndroidRuntime: Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.paragon.defenders-aSWKRXZFLeJtYnRdOEyUKQ==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.<init>(DexFile.java:101)
at dalvik.system.DexFile.<init>(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:83)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:735)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:818)
at android.app.LoadedApk.getResources(LoadedApk.java:1041)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2394)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5913)
at android.app.ActivityThread.access$1300(ActivityThread.java:207)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1748)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Is there another dependency that needs to be updated? Or currently version 4.8.1 is not stable yet for android 9?
My device - OnePlus 6T
The reason for the issue is Apache HTTP client deprecation beginning with Android 9.
Add this to your AndroidManifest.xml to fix:
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
The problem was that my compileSdkVersion was 28 and when i ran the app on Android 9 i got this exception, I've changed it to 26 and the app is working now.