Error inflating class android.webkit.WebView on android 5

后端 未结 4 1050
滥情空心
滥情空心 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 18:48

    24 April 2020, I solved it with this:

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

    Previous and not working version is below:

    implementation 'androidx.appcompat:appcompat:1.1.0'
    

    @canerkaseler

    0 讨论(0)
  • 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

    0 讨论(0)
  • 2021-02-07 19:03

    I have over ten apps, All of my apps have "Inflating problems" I was trying to solve problems... And I have tested with emulators and real device, they have no crash ... But My user thus! Finally while testing with emulator , I catched crash.. Here is result: This answer writing with 19 April 2020:

    androidx.appcompat:appcompat:1.2.0-beta01
    androidx.appcompat:appcompat:1.2.0-alpha03
    androidx.appcompat:appcompat:1.2.0-alpha02
    

    above versions have Serious problems.... Creating dialog, cause Edittext or TextView inflating problems...

    below versions have been tested a little but there were no crash

    androidx.appcompat:appcompat:1.2.0-alpha01
    androidx.appcompat:appcompat:1.1.0 
    

    Still testing this versions , will share results

    0 讨论(0)
  • 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'
    
    0 讨论(0)
提交回复
热议问题