Why does Android OS 8 WebVew with HTML select tag crash the app

I have same issue on Android 8.0 . finally i solve it. Try to update your compileSdkVersion to 26, and update your com.android.support:appcompat-v7 to 26.


In AndroidX land (limited to a minimum compileSDKVersion 28), I was also getting this issue on a Marshmallow emulator with a popup spinner. I don't go anywhere near Resources so this is still a platform issue with one of the support libs.

I managed to get it working - not by moving the webview to an Activity (although I did try that, it was unnecessary), - but by adding it programmatically with a wrapped context and a standard AppCompat theme:

val webView = WebView(ContextThemeWrapper(activity, R.style.Theme_AppCompat_Light))
binding.webViewContainer.addView(webView)

I don't understand wtf is going on here but right now it works. Good luck people!

EDIT I have looked into this a lot more and found the dependency which is causing issues for me. A particular version of the material components library is actually inducing this in webviews (1.1.0-alpha06 to be precise). I have asked a question on it here, with a sample project.


If anyone is still having this issue, I found that it wasn't even my code that was subclassing the Resources class but rather the Google support library version that I was using. Updated the support library version and it worked like a charm!


Looks like this bug: https://issuetracker.google.com/issues/77246450

Don't subclass resources...won't be fixed apparently.