Error inflating class android.webkit.WebView on android 5

后端 未结 4 1049
滥情空心
滥情空心 2021-02-07 18:41

I got the following error testing on Android 5.0 (API 21). Tested on other OS versions works well.

java.lang.RuntimeException: Unable to start activity

4条回答
  •  借酒劲吻你
    2021-02-07 19:15

    Recently I faced the same, There is an issue which is mentioned over here, which is not solved yet. The crash only occurs on API 21.

    There are few solutions which mention downgrading the androidx.appcompat:appcompat versions. This answer helped me. Also, there are other possible workarounds mentioned, pick the answer that applies to you.

    EDIT: The crash also occurs on API 22 and 23 if the user doesn't have Google Play installed.

    EDIT 2: As mentioned in the issue tracker here, and upgrading the androidx.appcompat:appcompat version to 1.2.0-alpha02 is providing the fix in some cases. Please go through a detailed discussion to find a suitable workaround.

    As mentioned by @MiguelSlv adding this maven repository is a temporary fix, However, all the above workarounds have side effects. As the bug is not fixed yet, it is not a clean solution.

    EDIT 3: As of May, 2020, there is a fix.

    implementation 'androidx.appcompat:appcompat:1.2.0-beta01'
    

    Previous not working version:

    implementation 'androidx.appcompat:appcompat:1.1.0'
    

提交回复
热议问题