Error inflating class android.webkit.WebView on android 5

后端 未结 4 1056
滥情空心
滥情空心 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:02

    This answer I am writing in Mar, 2020, could be changed after that.

    In my case , in build.gradle (app level), I changed

    implementation 'androidx.appcompat:appcompat:1.0.0'
    

    to

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

    and the Problem is solved.

    Other configuration I already have, but I didn't change them:-

    1. In Gradle project level
    classpath 'com.android.tools.build:gradle:3.5.3'
    
    1. And in gradle-wrapper.properties
    distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
    
    1. And in gradle app level
    android {
        compileSdkVersion 29
        buildToolsVersion '29.0.2'
        ...
    }
    

    Noting that this solution is tested on real device with android version 5

提交回复
热议问题