Issue
After upgrading to "androidx.appcompat:appcompat:1.0.2"
and "com.google.android.material:material:1.1.0-beta01"
the WebView crashes on devices with Android 5.0 and throws this exeption android.view.InflateException
Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class android.webkit.WebView
How can I fix it?
Solution
As explained here, this issue is due to the this revision. It affects Lollipop devices with webview version<50. Use the following code as a solution.
override fun applyOverrideConfiguration(overrideConfiguration: Configuration?) {
if (Build.VERSION.SDK_INT in 21..25 && (resources.configuration.uiMode == AppConstants.appContext.resources.configuration.uiMode)) {
return
}
super.applyOverrideConfiguration(overrideConfiguration)
}
Answered By - A R Mythili Saran
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.