4

I get some exceptions on my Android project. When I start the project, I get these exceptions. App doesn't crash on emulator. But on Google play developer console, there are lots of crash because of these exceptions

I tried everything. Now I tried to get rid of this problem with using androidX and com.android.support but didn't work! Also, there is no answer on stack overflow to solve the issue.

Here it is error message I get

2019-07-08 20:53:41.628 15998-15998/com.packete name I/zygote: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.packete name-LZ0pkpz1KqBv7BPInTJnWw==/base.apk"],nativeLibraryDirectories=[/data/app/com.packete name-LZ0pkpz1KqBv7BPInTJnWw==/lib/x86, /system/lib, /vendor/lib]]

2019-07-08 20:53:41.628 15998-15998/com.packete name I/zygote: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125) 2019-07-08 20:53:41.629 15998-15998/com.packete name I/zygote: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.packete name-LZ0pkpz1KqBv7BPInTJnWw==/base.apk"],nativeLibraryDirectories=[/data/app/com.packete name-LZ0pkpz1KqBv7BPInTJnWw==/lib/x86, /system/lib, /vendor/lib]]

2019-07-08 20:53:41.629 15998-15998/com.packete name I/zygote: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)

2019-07-08 20:53:41.630 15998-15998/com.packete name I/zygote: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.packete name-LZ0pkpz1KqBv7BPInTJnWw==/base.apk"],nativeLibraryDirectories=[/data/app/com.packete name-LZ0pkpz1KqBv7BPInTJnWw==/lib/x86, /system/lib, /vendor/lib]]

2019-07-08 20:53:41.630 15998-15998/com.packete name I/zygote: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)

2019-07-08 20:53:42.011 15998-15998/com.packete name I/zygote: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.webkit.TracingController" on path: DexPathList[[zip file "/data/app/com.android.chrome-feJOv4zSelnFLK27fJNkiw==/base.apk"],nativeLibraryDirectories=[/data/app/com.android.chrome-feJOv4zSelnFLK27fJNkiw==/lib/x86, /data/app/com.android.chrome-feJOv4zSelnFLK27fJNkiw==/base.apk!/lib/x86, /system/lib, /vendor/lib]]

2019-07-08 20:53:42.011 15998-15998/com.packete name I/zygote: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)

TuracBey
  • 232
  • 2
  • 10
  • 1
    This question is not duplicate! I already know that there are other topics and they don't provide any solution! – TuracBey Jul 08 '19 at 21:16

1 Answers1

1

fixed by: put following into build.gradle

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == "com.android.support") {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion "26.+"
            }
        }
    }
}

In case you're using androidx:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == "androidx") {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion "${targetSdk}.+"
            }
        }
    }
}
  • 1
    Hello, I have tried it before when I was searching but it didn't work. – TuracBey Jul 08 '19 at 19:33
  • tempted to -1 but it probably worked for someone @Dasharath Singh Bajroliya but I hate when people -1. They should remove that feature. Anyways, API 24, this doesn't seem to help :(. thanks for posting though. – Dean Hiller Aug 09 '20 at 02:32