0

I have custom Webview in android application which opens a webpage containing ** html dropdown List(Select HTML Tag)**. Whenever I click on this dropdown list app got crashed.

This crash is happening on Samsung Tab Android Version 9.0 and It's working fine at Samsung Tab version 7.0, Google Pixel Mobile V9.0, Samsung Mobile device V7.0,V6.0 are also working fine. It's working fine with Tab Emulator version 8.0, 9.0 as well.

I did lots of research but no luck. There are many posts where people were facing the same issue in the past with Android Version 8.0 but there is no proper solution for the same.

Someone said that it's happening because we are passing ApplcationContext to the fragment(which contains Webview) and suggested to add tool:context with Activity context in XML but it didn't work.

Reference Link:- Trying to open SELECT tag in Android WebView crashes the application

Trying to open SELECT tag in Android WebView crashes the application

I didn't try it on any other brand devices(except Samsung) with the same version V9.0 but I think it's happening only Samsung Tab device version 9.0 as it's not crashing on Emulators with the same version and not even on mobile devices

So, I'm not sure why it's happening. Can some please look into it and provide a proper solution.

2019-09-27 12:56:56.508
13968-13968/****************************************pe
D/InputMethodManager: startInputInner - Id : 0 2019-09-27 12:56:56.508
13968-13968/****************************************pe
I/InputMethodManager: startInputInner -
mService.startInputOrWindowGainedFocus 2019-09-27 12:56:56.512
13968-13968/****************************************pe
D/InputTransport: Input channel constructed: fd=198 2019-09-27
12:56:56.513 13968-13968/****************************************pe
D/InputTransport: Input channel destroyed: fd=171 2019-09-27
12:56:56.665 13968-13968/****************************************pe
******: android.view.InflateException: Binary XML file line #32: Binary XML file line #32: Error inflating class TextView 2019-09-27
12:56:56.666 13968-13968/****************************************pe
******: Caused by: android.view.InflateException: Binary XML file line #32: Error inflating class TextView 2019-09-27 12:56:56.668 13968-13968/****************************************pe ******: Caused
by: android.content.res.Resources$NotFoundException: Unable to find
resource ID #0x20b019d 2019-09-27 12:56:56.669
13968-13968/****************************************pe ******:     at
android.content.res.ResourcesImpl.getResourceEntryName(ResourcesImpl.java:291)
2019-09-27 12:56:56.699
13968-13968/****************************************pe ******:     at
org.chromium.content.browser.input.SelectPopup.show(PG:40) 2019-09-27
12:56:56.699 13968-13968/****************************************pe
******:     at android.os.MessageQueue.nativePollOnce(Native Method) 2019-09-27 12:56:56.699
13968-13968/****************************************pe ******:     at
android.os.MessageQueue.next(MessageQueue.java:326) 2019-09-27
12:56:56.699 13968-13968/****************************************pe
******:     at android.os.Looper.loop(Looper.java:181) 2019-09-27 12:56:56.700 13968-13968/****************************************pe
******:     at android.app.ActivityThread.main(ActivityThread.java:7179) 2019-09-27
12:56:56.700 13968-13968/****************************************pe
******:     at java.lang.reflect.Method.invoke(Native Method) 2019-09-27 12:56:56.700
13968-13968/****************************************pe ******:     at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
2019-09-27 12:56:56.701
13968-13968/****************************************pe ******:     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
2019-09-27 12:56:56.725
13968-13968/****************************************pe A/chromium:
[FATAL:jni_android.cc(249)] Please include Java exception stack in
crash report
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Rock
  • 9
  • 1
  • 8
  • It says: `Unable to find resource ID #0x20b019d`. It should help. – Phantômaxx Oct 05 '19 at 15:00
  • Yes but I'm not able to understand why it's not able to find this resource id because I didn't add any resource. It's the default behavior of webview when clicking on the HTML dropdown list which will trigger this resource call. – Rock Oct 05 '19 at 21:43
  • It has nothing to do with the WebView per se. You must be referring some resuorce which can't be found - this may happen when you try to fiddle with the R.java file – Phantômaxx Oct 06 '19 at 07:37
  • We are not explicitly referencing any resource. It's default behavior which is working fine with other devices except for Samsung Tab Version 9.0. – Rock Oct 07 '19 at 10:21
  • Then there must be some *implicit* reference. – Phantômaxx Oct 07 '19 at 12:22
  • Yes. that's the problem and don't know how can I fix this. So, if you have any idea then pls let me know. – Rock Oct 07 '19 at 12:25
  • Maybe it's a bug in Samsung's custom implementation of the WebView. – Phantômaxx Oct 07 '19 at 12:28
  • Maybe.. but I didn't find any reported issue for the same. – Rock Oct 07 '19 at 14:33
  • I'm facing the same Issue. Any news on your side? – Besnik May 06 '20 at 17:53

2 Answers2

0

here you need to make change in manifest.xml file inside tag insert:

android:cleartextTrafficPermitted="true"

for more here helpful video link: webview error resolving

sure, it will helpful for you.

  • I saw the linked video which shows that your solution is not to load the web URL for Android 9.0. But in my case, Webpage is loading in Android Webview but whenever I'm clicking on the HTML dropdown list then It's crashing. So, will it work for my problem? – Rock Oct 05 '19 at 22:05
  • Can I get any solution to this problem? – Rock Oct 30 '19 at 11:48
0

This error comes because of the support libraries we use in android. they have some sort of bug in them. if you are using androidx and then use this particular version of the support library in your app's gradle file and it should work fine

implementation 'androidx.appcompat:appcompat:1.0.0'

This worked for me.

Huzefa Gadi
  • 1,129
  • 1
  • 7
  • 11