crowdin / crowdin/mobile-sdk-android

Crowdin CrowdinResources crashes on non-app resource IDs

Open
#347 2 comments 0 reactions 0 assignees View on GitHub
bug good first issue
Dominant language
Kotlin
Stars
130
Forks
60
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When WebView (Chromium) calls getString() with its own internal resource IDs, CrowdinResources tries to resolve getResourceEntryName() for those IDs. Since they don't exist in the host app's resource table, it throws

Resources$NotFoundException instead of falling back to the original Resources, causing a fatal crash.

**To Reproduce**
Opening webview on certain phones will cause this to appear.

**Expected behavior**
Open webview normally

**Screenshots**
no

**Smartphone (please complete the following information):**
- Device: OnePlus NE2211
- OS: Android 9

**Additional context**
Add any other context about the problem here.
```
android.content.res.Resources$NotFoundException: Unable to find resource ID #0x214022e
at android.content.res.ResourcesImpl.getResourceEntryName(ResourcesImpl.java:378)
at android.content.res.Resources.getResourceEntryName(Resources.java:2002)
at com.crowdin.platform.CrowdinResources.getResourceEntryName(CrowdinResources.kt:212)
at com.crowdin.platform.CrowdinResources.getString(CrowdinResources.kt:46)
at android.content.Context.getString(Context.java:578)
at org.chromium.content.browser.selection.SelectionPopupControllerImpl.D(chromium-Monochrome.aab-stable-666807027:16)
at yA.onCreateActionMode(chromium-Monochrome.aab-stable-666807027:28)
at com.android.internal.policy.DecorView$ActionModeCallback2Wrapper.onCreateActionMode(DecorView.java:2457)
at com.android.internal.policy.DecorView.startActionMode(DecorView.java:902)
at com.android.internal.policy.DecorView.startActionModeForChild(DecorView.java:858)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:985)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:985)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:985)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:985)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:985)
at android.view.View.startActionMode(View.java:6800)
at org.chromium.content.browser.selection.SelectionPopupControllerImpl.K(chromium-Monochrome.aab-stable-666807027:88)
at org.chromium.content.browser.selection.SelectionPopupControllerImpl.M(chromium-Monochrome.aab-stable-666807027:283)
at EM3.a(chromium-Monochrome.aab-stable-666807027:38)
at aZ3.k(chromium-Monochrome.aab-stable-666807027:7)
at Jo.run(chromium-Monochrome.aab-stable-666807027:17)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:160)
at android.app.ActivityThread.main(ActivityThread.java:6846)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:518)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

org.chromium.base.JniAndroid$UncaughtExceptionException: Native stack trace:
#00 pc 0x000000000260ab97 /data/downloads/com.android.chrome/lib/x86_64/libmonochrome.so
#01 pc 0x0000000003222b49 /data/downloads/com.android.chrome/lib/x86_64/libmonochrome.so
#02 pc 0x0000000003222aa5 /data/downloads/com.android.chrome/lib/x86_64/libmonochrome.so
#03 pc 0x00000000030267d3 /data/downloads/com.android.chrome/lib/x86_64/libmonochrome.so
#04 pc 0x0000000005faa778 /data/downloads/com.android.chrome/lib/x86_64/libmonochrome.so
#05 pc 0x0000000005faadef /data/downloads/com.android.chrome/lib/x86_64/libmonochrome.so
#06 pc 0x0000000005fc6c7c /data/downloads/com.android.chrome/lib/x86_64/libmonochrome.so
#07 pc 0x0000000005fc6c39 /data/downloads/com.android.chrome/lib/x86_64/libmonochrome.so
#08 pc 0x0000000005fc698f /data/downloads/com.android.chrome/lib/x86_64/libmonochrome.so
#09 pc 0x0000000000014024 /system/lib64/libutils.so
#10 pc 0x0000000000013bd9 /system/lib64/libutils.so
#11 pc 0x00000000000eb9e5 /system/lib64/libandroid_runtime.so

at org.chromium.base.JniAndroid.handleException(chromium-Monochrome.aab-stable-666807027:21)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:160)
at android.app.ActivityThread.main(ActivityThread.java:6846)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:518)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.