restring: Restring library not working for Samsung devices Android 9 webview

Hi @B3nedikt ,

We have observed crashes in Samsung device with Android version 9 for webview. Whenever there is a click on CalendarView / DatePicker / NumberPicker, the app is crashing.

Below are the SDKs used in our app :

// Replace bundled strings dynamically implementation “dev.b3nedikt.restring:restring:5.2.2” // Intercept view inflation implementation “dev.b3nedikt.viewpump:viewpump:4.0.13” // Allows to update the text of views at runtime without recreating the activity implementation “dev.b3nedikt.reword:reword:4.0.4”

Please find below crash log:

android.content.res.Resources$NotFoundException: Unable to find resource ID #0x20c0050
20:04:40.290  W  	at android.content.res.ResourcesImpl.getResourceEntryName(ResourcesImpl.java:279)
20:04:40.290  W  	at android.content.res.Resources.getResourceEntryName(Resources.java:2002)
20:04:40.290  W  	at dev.b3nedikt.restring.internal.ResourcesDelegate.getStringFromRepository(ResourcesDelegate.kt:135)
20:04:40.290  W  	at dev.b3nedikt.restring.internal.ResourcesDelegate.getText(ResourcesDelegate.kt:64)
20:04:40.290  W  	at dev.b3nedikt.restring.internal.RestringResources.getText(RestringResources.kt:50)
20:04:40.290  W  	at android.content.Context.getText(Context.java:565)
20:04:40.290  W  	at org.chromium.content.browser.picker.InputDialogContainer.showPickerDialog(InputDialogContainer.java:52)
20:04:40.290  W  	at org.chromium.content.browser.picker.InputDialogContainer.showPickerDialog(InputDialogContainer.java:22)
20:04:40.290  W  	at org.chromium.content.browser.input.DateTimeChooserAndroid.createDateTimeChooser(DateTimeChooserAndroid.java:12)
20:04:40.290  W  	at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
20:04:40.290  W  	at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:9)
20:04:40.290  W  	at android.os.Handler.dispatchMessage(Handler.java:106)

Is there a workaround to fix this issue ?

Thanks !!

About this issue

  • Original URL
  • State: open
  • Created 7 months ago
  • Comments: 33 (16 by maintainers)

Most upvoted comments

I don’t have a fix yet, but I just pushed another change to the PR I linked above, can you try it out?

Hi 😃 I created a PR, with a web view in the sample app that uses different elements which show native dialogs like a date picker etc. here. Please try it out on your Samsung device, if you can find a fix.

I think I will upload a version of ViewPump tomorrow where you can try different stuff out in the sample app. This should speed things up a bit 😉

Seems like there are still issues with loading all resources. No update at the moment, I would say the next step would be to try using the unwrapped context when inflating. I will create a new alpha version which does this later.