BranchMetrics / android-branch-deep-linking-attribution

The Branch Android SDK for deep linking and attribution. Branch helps mobile apps grow with deep links / deeplinks that power paid acquisition and re-engagement campaigns, referral programs, content sharing, deep linked emails, smart banners, custom user onboarding, and more.
https://docs.branch.io/pages/apps/android/
MIT License
399 stars 156 forks source link

BranchEvent.logEvent: JniAndroid UncaughtExceptionException #1172

Closed kevinguitar closed 6 months ago

kevinguitar commented 6 months ago

Describe the bug

Fatal Exception: org.chromium.base.JniAndroid$UncaughtExceptionException
Native stack trace: #00 pc 0x00000000040ef4ff /data/app/~~a8ifdw7pWvKOPIS9dgweyw==/com.google.android.trichromelibrary_626106633-sec4emjh2BdhnQOquhlEYA==/base.apk (offset 0x8dc000) #01 pc 0x0000000002c9a467 /data/app/~~a8ifdw7pWvKOPIS9dgweyw==/com.google.android.trichromelibrary_626106633-sec4emjh2BdhnQOquhlEYA==/base.apk (offset 0x8dc000) #02 pc 0x0000000002c9936f /data/app/~~a8ifdw7pWvKOPIS9dgweyw==/com.google.android.trichromelibrary_626106633-sec4emjh2BdhnQOquhlEYA==/base.apk (offset 0x8dc000) #03 pc 0x0000000003ef889b /data/app/~~a8ifdw7pWvKOPIS9dgweyw==/com.google.android.trichromelibrary_626106633-sec4emjh2BdhnQOquhlEYA==/base.apk (offset 0x8dc000) #04 pc 0x0000000003ef9453 /data/app/~~a8ifdw7pWvKOPIS9dgweyw==/com.google.android.trichromelibrary_626106633-sec4emjh2BdhnQOquhlEYA==/base.apk (offset 0x8dc000) #05 pc 0x0000000003ef3393 /data/app/~~a8ifdw7pWvKOPIS9dgweyw==/com.google.android.trichromelibrary_626106633-sec4emjh2BdhnQOquhlEYA==/base.apk (offset 0x8dc000) #06 pc 0x0000000003e82143 /data/app/~~a8ifdw7pWvKOPIS9dgweyw==/com.google.android.trichromelibrary_626106633-sec4emjh2BdhnQOquhlEYA==/base.apk (offset 0x8dc000) #07 pc 0x000000000471b55f /data/app/~~a8ifdw7pWvKOPIS9dgweyw==/com.google.android.trichromelibrary_626106633-sec4emjh2BdhnQOquhlEYA==/base.apk (offset 0x8dc000) #08 pc 0x00000000046f8d9b /data/app/~~a8ifdw7pWvKOPIS9dgweyw==/com.google.android.trichromelibrary_626106633-sec4emjh2BdhnQOquhlEYA==/base.apk (offset 0x8dc000) #09 pc 0x0000000002c8a273 /data/app/~~a8ifdw7pWvKOPIS9dgweyw==/com.google.android.trichromelibrary_626106633-sec4emjh2BdhnQOquhlEYA==/base.apk (offset 0x8dc000) #10 pc 0x0000000002c519a7 /data/app/~~a8ifdw7pWvKOPIS9dgweyw==/com.google.android.trichromelibrary_626106633-sec4emjh2BdhnQOquhlEYA==/base.apk (offset 0x8dc000) #11 pc 0x0000000002c514e7 /data/app/~~a8ifdw7pWvKOPIS9dgweyw==/com.google.android.trichromelibrary_626106633-sec4emjh2BdhnQOquhlEYA==/base.apk (offset 0x8dc000)

Caused by android.content.res.Resources$NotFoundException
Resource ID #0x20c0006

android.content.res.ResourcesImpl.getValue (ResourcesImpl.java:260)
android.content.res.Resources.getInteger (Resources.java:1219)
org.chromium.ui.base.DeviceFormFactor.isTablet (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:9)
J.N.M1Y_XVCN (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633)
org.chromium.content.browser.BrowserStartupControllerImpl.d (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:110)
WV.x5.run (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:182)
java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:487)
java.util.concurrent.FutureTask.run (FutureTask.java:264)
org.chromium.base.task.PostTask.d (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:11)
org.chromium.android_webview.AwBrowserProcess.j (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:34)
com.android.webview.chromium.M.e (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:198)
com.android.webview.chromium.M.b (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:42)
com.android.webview.chromium.WebViewChromiumFactoryProvider.getStatics (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:16)
android.webkit.WebSettings.getDefaultUserAgent (WebSettings.java:1396)
io.branch.referral.DeviceInfo.getDefaultBrowserAgent (DeviceInfo.java:306)
io.branch.referral.DeviceInfo.updateRequestWithV2Params (DeviceInfo.java:218)
io.branch.referral.ServerRequest.setPost (ServerRequest.java:236)
io.branch.referral.ServerRequestLogEvent.setPost (ServerRequestLogEvent.java:59)
io.branch.referral.ServerRequestLogEvent.<init> (ServerRequestLogEvent.java:50)
io.branch.referral.util.BranchEvent$1.<init> (BranchEvent.java:267)
io.branch.referral.util.BranchEvent.logEvent (BranchEvent.java:266)
io.branch.referral.util.BranchEvent.logEvent (BranchEvent.java:247)

Steps to reproduce

Haven't figured out a way to reproduce, but looks like it's an internal issue in chromium. https://issues.chromium.org/issues/40205792

Expected behavior

No crash, event is sent successfully.

SDK Version

5.9.0

Make and Model

Various models

OS

Various OS

Additional Information/Context

We understand it's not an issue on your end, but would be nice to try catch this method from your side, we will try catch it on our side for now to avoid crashing, but the event will likely not going to be sent.

kevinguitar commented 6 months ago

I've checked the repo, and the try catch is already implemented in place, looks like it crashes outside of the thread, will close it, I think we will need to wait for Chromium's fix.

java.util.concurrent.FutureTask.run (FutureTask.java:264) org.chromium.base.task.PostTask.d (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:11) org.chromium.android_webview.AwBrowserProcess.j (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:34) com.android.webview.chromium.M.e (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:198) com.android.webview.chromium.M.b (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:42) com.android.webview.chromium.WebViewChromiumFactoryProvider.getStatics (chromium-TrichromeWebViewGoogle6432.aab-stable-626106633:16)