Skip to content

Crash in RootViewWatcher$listener$1.onRootViewAdded #2698

@sankiran-s

Description

@sankiran-s

Description

This exception causes our app to crash at runtime.
Also, it seems to happen mostly in views that host a webview.

       at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:261)
       at android.content.res.Resources.getBoolean(Resources.java:1251)
       at leakcanary.RootViewWatcher$listener$1.onRootViewAdded(RootViewWatcher.kt:53)
       at curtains.OnRootViewAddedListener$DefaultImpls.onRootViewsChanged(OnRootViewAddedListener.java:38)
       at leakcanary.RootViewWatcher$listener$1.onRootViewsChanged(RootViewWatcher.kt:43)
       at curtains.internal.RootViewsSpy$delegatingViewList$1.add(RootViewsSpy.kt:25)
       at curtains.internal.RootViewsSpy$delegatingViewList$1.add(RootViewsSpy.kt:23)
       at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:554)
       at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:150)
       at android.app.Dialog.show(Dialog.java:512)
       at WV.hM.a(chromium-TrichromeWebViewGoogle6432.aab-dev-662800033:3)
       at org.chromium.content.browser.input.SelectPopup.show(chromium-TrichromeWebViewGoogle6432.aab-dev-662800033:174)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:335)
       at android.os.Looper.loopOnce(Looper.java:187)
       at android.os.Looper.loop(Looper.java:319)
       at android.app.ActivityThread.main(ActivityThread.java:8918)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Upon analyzing the APK, I found that the resource is indeed present inside the APK.
Screenshot 2024-08-09 at 2 09 48 PM
Also, the R8 resource mapping maps to the correct resource ID as well.
bool:leak_canary_watcher_watch_dismissed_dialogs:2131034121 (0x7f050009 in hexadecimal)

Steps to Reproduce

We haven't been able to reproduce the issue on our end, but we're seeing several users affected across OEMs, and Android versions.

Expected behavior: App should not crash

Version Information

  • LeakCanary version: 2.14
  • Android OS version: Android 10 through Android 14
  • Gradle version: 8.8

Additional Information

Android Gradle Plugin version: 8.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions