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

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

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 33
  • Comments: 43 (5 by maintainers)

Most upvoted comments

Same for me… help me

Harmless

You mean intrusive, ugly, and log polluting?

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

For me the version resolved this issue was 1.4.0-alpha01, not below 1.3.0. implementation 'androidx.core:core:1.4.0-alpha01'

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"

Same problem here, is there a fix?

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)

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

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

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.

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 ???