安卓7.0上的WebView InflateException问题

3

我的应用程序中有一个 WebView,而且我从用户那里得到了许多关于在 Android 7.0 上膨胀 WebView 片段时出现相同错误的报告。

错误日志:

android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class android.webkit.WebView Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class android.webkit.WebView

WebView 片段布局:

<android.support.v7.widget.LinearLayoutCompat 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/background">

    <WebView
        android:id="@+id/wvAparat"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="16dp" />

</android.support.v7.widget.LinearLayoutCompat>

我从这些设备中得到了以下错误:

SM-G950F Android 7.0

SM-J330F Android 7.0

Moto E (4) Plus Android 7.1.1


可能导致错误的原因是 android.support.v7.widget.LinearLayoutCompat,它与webview无关。 - Tejas Pandya
@Tej 或许我会测试一下。 - FarshidABZ
@VolkanSahin45,没有明确的错误是Android视图InflateException。 - FarshidABZ
尝试使用LinearLayout而不是android.support.v7.widget.LinearLayoutCompat - Tejas Pandya
1个回答

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接