HTML Option crashes the WebView on Android 6
See original GitHub issueDescription: On Android 6, within a WebView, using com.google.android.material:material version >= 1.1.0, the render of an html option will crash the app. This doesn’t happen on Android > 6.
Expected behaviour: HTML Option should be rendered without crashing the app.
Source code:
<form>
<select>
<option>Option One</option>
<option>Option Two</option>
</select>
</form>
Android API version: 23
Material Library version: 1.1.0-alpha06, 1.2.0-alpha04, any > 1.0.0.
Device: SAMSUNG-SM-G900V (or any running Android 6).
Stacktrace: 02-06 14:18:31.467 930-930/com.ft.news E/AndroidRuntime: FATAL EXCEPTION: main Process: com.ft.news, PID: 930 android.content.res.Resources$NotFoundException: Resource ID #0x0 at android.content.res.Resources.getValue(Resources.java:2558) at android.content.res.Resources.loadXmlResourceParser(Resources.java:4360) at android.content.res.Resources.getLayout(Resources.java:2372) at android.view.LayoutInflater.inflate(LayoutInflater.java:427) at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:378) at android.widget.ArrayAdapter.getView(ArrayAdapter.java:369) at Hv.getView(PG:13) at android.widget.AbsListView.obtainView(AbsListView.java:2929) at android.widget.ListView.measureHeightOfChildren(ListView.java:1305) at android.widget.ListView.onMeasure(ListView.java:1212) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6330) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6330) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6330) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464) at android.widget.LinearLayout.measureVertical(LinearLayout.java:747) at android.widget.LinearLayout.onMeasure(LinearLayout.java:629) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6330) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6330) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:20151) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6330) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:3158) at android.view.View.measure(View.java:20151) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2594) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1524) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1841) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7397) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920) at android.view.Choreographer.doCallbacks(Choreographer.java:695) at android.view.Choreographer.doFrame(Choreographer.java:631) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
Faced a similar issue and it’s coming from appcompat v1.1.0 which is shipped with
material-components
. However, there’s a potential fix for certain cases here https://stackoverflow.com/a/58355733If you want more information, it looks like this is the bug that was fixed in 1.2.0-alpha02 of appcompat: http://issuetracker.google.com/issues/141351441