ckChangeLog icon indicating copy to clipboard operation
ckChangeLog copied to clipboard

Resources$NotFoundException: String resource via ChangeLog.getDialog

Open johnjohndoe opened this issue 5 years ago • 8 comments

I noticed a few occurrences of the following error being reported in the Google Developer Console of my app. I am using version 1.2.2 of the library.

I am able to reproduce the crash with an Android emulator API level 21, 5.0.2, Google APIs Intel x86 Atom_64 System Image, Revision 31.

Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x2040002
    at android.content.res.Resources.getText(Resources.java:274)
    at android.content.res.Resources.getString(Resources.java:360)
    at com.android.org.chromium.content.browser.ContentViewCore.setContainerView(ContentViewCore.java:702)
    at com.android.org.chromium.content.browser.ContentViewCore.initialize(ContentViewCore.java:608)
    at com.android.org.chromium.android_webview.AwContents.createAndInitializeContentViewCore(AwContents.java:619)
    at com.android.org.chromium.android_webview.AwContents.setNewAwContents(AwContents.java:758)
    at com.android.org.chromium.android_webview.AwContents.<init>(AwContents.java:608)
    at com.android.org.chromium.android_webview.AwContents.<init>(AwContents.java:546)
    at com.android.webview.chromium.WebViewChromium.initForReal(WebViewChromium.java:312)
    at com.android.webview.chromium.WebViewChromium.access$100(WebViewChromium.java:97)
    at com.android.webview.chromium.WebViewChromium$1.run(WebViewChromium.java:264)
    at com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue.drainQueue(WebViewChromium.java:124)
    at com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue$1.run(WebViewChromium.java:111)
    at com.android.org.chromium.base.ThreadUtils.runOnUiThread(ThreadUtils.java:144)
    at com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue.addTask(WebViewChromium.java:108)
    at com.android.webview.chromium.WebViewChromium.init(WebViewChromium.java:261)
    at android.webkit.WebView.<init>(WebView.java:548)
    at android.webkit.WebView.<init>(WebView.java:483)
    at android.webkit.WebView.<init>(WebView.java:466)
    at android.webkit.WebView.<init>(WebView.java:453)
    at android.webkit.WebView.<init>(WebView.java:443)
    at de.cketti.library.changelog.ChangeLog.getDialog(ChangeLog.java:287)
    at de.cketti.library.changelog.ChangeLog.getLogDialog(ChangeLog.java:265)
    at de.avpptr.umweltzone.base.BaseActivity.showChangeLogDialog(BaseActivity.java:174)
    at de.avpptr.umweltzone.map.MainActivity.onCreate(MainActivity.java:58)
    at android.app.Activity.performCreate(Activity.java:5937)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
    ... 10 more

johnjohndoe avatar May 08 '20 23:05 johnjohndoe

I believe this is an incompatibility of certain WebView versions and certain AppCompat versions.

cketti avatar May 08 '20 23:05 cketti

Can you try your app on that Android Version?

johnjohndoe avatar May 09 '20 09:05 johnjohndoe

See https://issuetracker.google.com/issues/141351441

Doesn't crash in K-9 Mail because we're using AppCompat 1.2.0-beta01. It does crash when I switch to AppCompat 1.1.0.

Side note: Testing this revealed that there's a vector drawable in K-9 Mail's About screen layout that will crash on Android 5 :see_no_evil:

cketti avatar May 09 '20 11:05 cketti

Oh, great. So you see any chance to fix this without updating to the beta version? A try/catch could suppress the crash at least.

johnjohndoe avatar May 09 '20 16:05 johnjohndoe

I don't want to change the library to deal with that bug. But it looks like your own code is in the stack trace. So you can add the try/catch yourself.

cketti avatar May 09 '20 16:05 cketti

Yes. I meant the app code. Is there any better solution?

johnjohndoe avatar May 09 '20 16:05 johnjohndoe

AppCompat 1.0.x probably also works.

cketti avatar May 09 '20 16:05 cketti

Side note: I checked on Android 5.1. No crash there.

johnjohndoe avatar May 09 '20 22:05 johnjohndoe