Android.View.Inflateexception Error Inflating Class Android.Webkit.Webview

android.view.InflateException Error inflating class android.webkit.WebView

If you use androidx.appcompat:appcompat:1.1.0, try androidx.appcompat:appcompat:1.0.2 instead.
it seems that 1.1.0 doesn't fix the bug with WebView in Android 5.1.1.

Feb-2020 update: Reverting to 1.0.2 stopped working for many people (including my app), but using the current version of androidx.appcompat:appcompat:1.2.0-alpha02 did fix the crash. (I was seeing it on a Huawei P8 Lite running Android 5.0 during Google's automated "Pre-launch report" testing).

Jun-2020 update: There are newer releases available than the one mentioned in the Feb-2020 update, you can see the currently available versions here:

  • https://developer.android.com/jetpack/androidx/releases/appcompat

Error inflating class android.webkit.WebView

I found the issue with the code.

It was related to localization library com.akexorcist:localization:1.2.9

Please check the issues section in github:
https://github.com/akexorcist/Localization/issues/105

Issue is solved in com.akexorcist:localization:1.2.10

Error inflating class android.webkit.WebView happens sporadically in production

If you see these reports from devices running Android Lollipop, please ignore them. This likely happens whenever something launches an activity that uses WebView while the WebView package is in the middle of being updated by Play Store (which can only happen on Lollipop currently). During updates, packages are treated as not installed by the package manager. That is, there is nothing wrong with your app. The time window while the updated package is considered non-existent is typically small, so when the app is relaunched after such a crash, it will start normally.

android.view.InflateException: Binary XML file line #10: Error inflating class android.webkit.WebView

I added a custome WebView class:

    public LollipopFixedWebView(Context context) {
super(getFixedContext(context));
}

public LollipopFixedWebView(Context context, AttributeSet attrs) {
super(getFixedContext(context), attrs);
}

public LollipopFixedWebView(Context context, AttributeSet attrs, int defStyleAttr) {
super(getFixedContext(context), attrs, defStyleAttr);
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public LollipopFixedWebView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(getFixedContext(context), attrs, defStyleAttr, defStyleRes);
}

public LollipopFixedWebView(Context context, AttributeSet attrs, int defStyleAttr, boolean privateBrowsing) {
super(getFixedContext(context), attrs, defStyleAttr, privateBrowsing);
}

public static Context getFixedContext(Context context) {
return context.createConfigurationContext(new Configuration());
}
}

Than I changed WebView tag to LollipopFixedWebView. It's worked for me.

WebView throws InflateException on android 5.0

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)
}

Error inflating class android.webkit.WebView when loading webview

Credit to Tom R for the answer.

In case anybody else encounters a similar problem, check what emulator you are running.

It appears I was running the emulator for Android Wear, more info can be found here on this if you are unaware.

It was fixed by changing this to just the standard ARM CPU from Wear ARM

Error inflating WebView XML

It seems that something strange ocurred when the app was inflating the WebView, could be whatever.

For the NameNotFoundException: com.google.android.webview I can deduce that could be a problem with the Google packages (The user could be using a custom ROM and not having them installed.)

If you had more info about the terminal with the error I'll say you go for it, but you have to see the proportion of users/users_with_this_error that you have. Then you could see if it's useful for you work in this issue or not.

From breakline's comment:
Check out this post, looks kinda like the same issue: NameNotFoundException webview



Related Topics



Leave a reply



Submit