首页 > 解决方案 > 使用有关 ChromeColors 和资源的 Chrome WebView 在 Android 上崩溃

问题描述

我最近在启动时看到了崩溃WebView

2021-10-08 12:55:56.478 26503-26503/? E/cr_WarmupManager: Inflation exception.
    android.view.InflateException: Binary XML file line #26: Binary XML file line #11: Error inflating class <unknown>
    Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class <unknown>
    Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
        at android.view.LayoutInflater.createView(LayoutInflater.java:647)
...
Caused by: java.lang.IllegalArgumentException: ChromeColors requires a value for the com.android.chrome:attr/0_resource_name_obfuscated attribute to be set in your app theme. You can either set the attribute in your theme or update your theme to inherit from Theme.MaterialComponents (or a descendant).
        at y12.c(chromium-Monochrome.aab-stable-460606123:5)
        at i00.b(chromium-Monochrome.aab-stable-460606123:4)
        at org.chromium.chrome.browser.compositor.CompositorView.g(chromium-Monochrome.aab-stable-460606123:5)
        at org.chromium.chrome.browser.compositor.CompositorView.<init>(chromium-Monochrome.aab-stable-460606123:5)
        at org.chromium.chrome.browser.compositor.CompositorViewHolder.<init>(chromium-Monochrome.aab-stable-460606123:15)

你见过类似的东西吗?会不会是因为WebView更新了?

标签: androidwebviewandroid-webview

解决方案


推荐阅读