sunflower icon indicating copy to clipboard operation
sunflower copied to clipboard

Didn't find class "android.view.View$OnUnhandledKeyEventListener"

Open hemantuno opened this issue 6 years ago • 43 comments

Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener; 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void androidx.appcompat.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at androidx.databinding.ViewDataBinding androidx.databinding.DataBindingUtil.setContentView(android.app.Activity, int, androidx.databinding.DataBindingComponent) (DataBindingUtil.java:303) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at androidx.databinding.ViewDataBinding androidx.databinding.DataBindingUtil.setContentView(android.app.Activity, int) (DataBindingUtil.java:284) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void com.google.samples.apps.sunflower.GardenActivity.onCreate(android.os.Bundle) (GardenActivity.kt:41) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6973) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1126) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2946) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3064) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.app.ActivityThread.-wrap14(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1659) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.os.Looper.loop() (Looper.java:154) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6823) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1557) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1445) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.google.samples.apps.sunflower-1/base.apk"],nativeLibraryDirectories=[/data/app/com.google.samples.apps.sunflower-1/lib/arm, /system/lib, /vendor/lib]] 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void androidx.appcompat.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at androidx.databinding.ViewDataBinding androidx.databinding.DataBindingUtil.setContentView(android.app.Activity, int, androidx.databinding.DataBindingComponent) (DataBindingUtil.java:303) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at androidx.databinding.ViewDataBinding androidx.databinding.DataBindingUtil.setContentView(android.app.Activity, int) (DataBindingUtil.java:284) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void com.google.samples.apps.sunflower.GardenActivity.onCreate(android.os.Bundle) (GardenActivity.kt:41) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6973) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1126) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2946) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3064) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.app.ActivityThread.-wrap14(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1659) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.os.Looper.loop() (Looper.java:154) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6823) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1557) 2019-01-01 14:55:15.987 29675-29675/com.google.samples.apps.sunflower I/art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1445) 201

hemantuno avatar Jan 01 '19 09:01 hemantuno

Harmless

iNoles avatar Jan 01 '19 16:01 iNoles

@hemantuno can you add more details on this error - what actions you performed when it happened, version of Android Studio, etc?

tiembo avatar Jan 02 '19 21:01 tiembo

Run code on Samsung(Galaxy Tab A(2017) ) device using android studio 3.2.1. Very first time run app then above logs display.

hemantuno avatar Jan 03 '19 04:01 hemantuno

Does Sunflower work when you run it on an emulator?

tiembo avatar Jan 05 '19 00:01 tiembo

Not try in emulator.

hemantuno avatar Jan 07 '19 04:01 hemantuno

Please try it in an emulator as to see if the error also happens there or only on the device.

tiembo avatar Jan 09 '19 23:01 tiembo

Same error in emulator.

hemantuno avatar Jan 10 '19 04:01 hemantuno

I'm unable to reproduce this. Can you try Android Studio 3.3 and in a new emulator? Also try doing a "File -> Invalidate caches / Restart" in Android Studio.

tiembo avatar Jan 14 '19 19:01 tiembo

I'm seeing this stack trace in my app. I'm using Android Studio 3.3, invalidated cache, running on an emulator. It's triggered after calling DataBindingUtil.setContentView(this, R.layout.activity):

Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
	at void androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) (ViewCompat.java:2420)
	at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
	at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
	at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
	at void androidx.appcompat.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:141)
	at androidx.databinding.ViewDataBinding androidx.databinding.DataBindingUtil.setContentView(android.app.Activity, int, androidx.databinding.DataBindingComponent) (DataBindingUtil.java:303)
	at androidx.databinding.ViewDataBinding androidx.databinding.DataBindingUtil.setContentView(android.app.Activity, int) (DataBindingUtil.java:284)

alashow avatar Jan 17 '19 18:01 alashow

Same stacktrace. Android Studio 3.3. Invalidated cache. Running on device. Device fails to execute anything else on the Activity.

 Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
     at void androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
     at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
     at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
     at void androidx.appcompat.app.AppCompatDelegateImpl.onPostCreate(android.os.Bundle) (AppCompatDelegateImpl.java:299)
     at void androidx.appcompat.app.AppCompatActivity.onPostCreate(android.os.Bundle) (AppCompatActivity.java:98)
     at void android.app.Instrumentation.callActivityOnPostCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1285)
     at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2760)

EloiNavarro avatar Jan 24 '19 11:01 EloiNavarro

Hi everyone - thanks for the error reports.

To help pinpoint the problem, please comment with the device you're using (even if it's an emulator), along with the OS version the device is running.

tiembo avatar Jan 24 '19 18:01 tiembo

More info here: https://issuetracker.google.com/issues/120750246

matpag avatar Feb 08 '19 09:02 matpag

Hello everyone, I also faced this issue. How can i resolve it?

pawankhandal52 avatar Feb 19 '19 09:02 pawankhandal52

Same problem for me... A workaround exists?

thx

gigaga avatar Mar 21 '19 08:03 gigaga

Same for me...

ding33211 avatar Apr 03 '19 06:04 ding33211

Same problem here, any workaround?

gururajphadnis avatar Apr 05 '19 11:04 gururajphadnis

Same for me... help me

zy666 avatar Apr 29 '19 11:04 zy666

Same problem here, is there a fix?

ytheekshana avatar May 05 '19 07:05 ytheekshana

Same problem here, is there a fix? No

hemantuno avatar May 06 '19 04:05 hemantuno

I also got this problem. Only thing I recently did was updating Android Studio to the latest version.

timniko avatar May 06 '19 10:05 timniko

Got the same problem while rebuilding the same app on the same phone (one month ago it was working fine)

demidrolk avatar May 07 '19 20:05 demidrolk

Whats the name of the class that is inaccesible?

b.h.i.u$b extended by class androidx.core.view.ViewCompat$5 is inaccessible

edit: Checking out the ViewCompat class file, at #2429:

v.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
  @Override
  public WindowInsets onApplyWindowInsets(View view, WindowInsets insets) {
    WindowInsetsCompat compatInsets = WindowInsetsCompat.wrap(insets);
    compatInsets = listener.onApplyWindowInsets(view, compatInsets);
    return (WindowInsets) WindowInsetsCompat.unwrap(compatInsets);
  }
});

Is something related to the 'insets' object that enforces us to use window insets in apps with android version <= Q ???

marlonlom avatar May 12 '19 23:05 marlonlom

have we got any lead on this problem guys?

irishikeshmane avatar May 17 '19 21:05 irishikeshmane

have we got any lead on this problem guys? no

hemantuno avatar May 20 '19 04:05 hemantuno

same problem for me, yesterday it was working and today it is showing this error. Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.example.examandresultlatestgovtjobs-1/base.apk", zip file "/data/app/com.example.examandresultlatestgovtjobs-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.examandresultlatestgovtjobs-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.examandresultlatestgovtjobs-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.examandresultlatestgovtjobs-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.examandresultlatestgovtjobs-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.examandresultlatestgovtjobs-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.examandresultlatestgovtjobs-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.examandresultlatestgovtjobs-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.examandresultlatestgovtjobs-1/split_lib_slice_7_apk.apk", zi

mrityunjay avatar May 20 '19 06:05 mrityunjay

I believe this error occurred after I change the app name in string.xml file.

mrityunjay avatar May 20 '19 06:05 mrityunjay

I have i my project gradle : implementation "androidx.core:core-ktx:+" -- Only this then by reference of this https://stackoverflow.com/questions/53229259/no-super-method-getlifecycle-after-migrating-to-androidx I solved it.

My Solution : change in gradle file, implementation "androidx.core:core:1.0.2" implementation "androidx.core:core-ktx:1.0.2"

var2611 avatar May 28 '19 20:05 var2611

Harmless

You mean intrusive, ugly, and log polluting?

nathan-fiscaletti avatar May 30 '19 00:05 nathan-fiscaletti

I have the same issue. After looking around, looks like this is a known bug in ViewCompat that's unlikely to be fixed. I found more information at https://stackoverflow.com/a/52954286/759719. If this is indeed a benign issue, the exception should be caught and logged at debug or trace level, rather than info level. This has a productivity impact on apps with clean logs, where a stack trace triggers alarm notifications. Unfortunately this is likely handled by a different Google team.

bryanwagner avatar Jun 05 '19 21:06 bryanwagner

This error often occurs when you enable multidex support for your apps. You may read more about it here

heyFahad avatar Jun 11 '19 22:06 heyFahad