【问题标题】:Android WebView InflateException on android 7.0Android 7.0 上的 Android WebView InflateException
【发布时间】:2018-06-05 15:13:11
【问题描述】:

我的应用程序上有 WebView,并且在膨胀 WebView 片段时,我在 android 7.0 上从用户那里收到了许多相同的错误。

错误日志:

android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class android.webkit.WebView 原因: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 安卓 7.0

SM-J330F Android 7.0

Moto E (4) Plus Android 7.1.1

【问题讨论】:

  • 可能是错误原因是android.support.v7.widget.LinearLayoutCompat它与webview无关
  • @Tej 也许,我会测试一下。
  • @VolkanSahin45 No error is clear android view InflateException.
  • 尝试使用 LinearLayout 而不是 android.support.v7.widget.LinearLayoutCompat

标签: android android-layout webview android-webview inflate-exception


【解决方案1】:

这绝对与设备有关。以下是更多信息的链接: https://www.androidpolice.com/2016/07/20/google-explains-chrome-will-become-webview-android-7-0/

如果您找到其中一台设备,我的预感是检查它们是否安装了 Chrome。如果没有,这就是你的答案。没有解决方法的想法。

【讨论】:

    猜你喜欢
    • 2020-02-16
    • 1970-01-01
    • 2017-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多