WordPress-Android
WordPress-Android copied to clipboard
RuntimeException: JSON Parse error: Unexpected end of input
Sentry Url: https://sentry.io/share/issue/b392449ada9e45049409392eb4c502af/ User Count: 164 Count: 428 First Release: 19.9-rc-2 First Seen: 2022-05-22T15:53:57.358000Z Last Seen: 2022-06-30T09:16:32Z 24 Hours: 22 30 Days: 429
RuntimeException: JSON Parse error: Unexpected end of input
SyntaxError: JSON Parse error: Unexpected end of input
at com.swmansion.reanimated.AndroidErrorHandler.raise(AndroidErrorHandler.java:6)
at com.swmansion.reanimated.Scheduler.triggerUI(Scheduler.java)
at com.swmansion.reanimated.Scheduler$1.run(Scheduler.java:24)
at com.swmansion.reanimated.Scheduler$2.runGuarded(Scheduler.java:43)
at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:31)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7889)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
Seems to be related to the reanimated library again (cc @fluiddot ?), yet it's apparently also appearing in 20.1-rc-* and 20.2-rc-1 (while I think we updated the lib recently).
PS: Reporting here in WPAndroid repo rather than gutenberg-mobile, because (1) I couldn't find a similar "JSON Parse error" in Sentry for WPiOS and (2) I think the groundskeeper (cc @twstokes) mostly triage issues in WPiOS/WPAndroid but they might not think to look and triage issues in gutenberg-mobile, so decided to report it here for visibility after all. Let me know if you prefer I do otherwise for cases like this in the future.
Definitely, the issue looks related to Reanimated library hence the Gutenberg Mobile side. I did a quick check on the Sentry event and noticed that this crash has more events in version 19.9 than 20.0, however, the adoption for 19.9 is now way lower than 20.0. It's not clear to me the reason for having fewer events on 20.0 because, as far as I checked, we didn't introduce either a dependency update or fix that could have helped reduce the crash 🤔 . In version 20.1, we have introduced an upgrade on react-native-gesture-handler that might help but still, not totally confident that would address it.
Being this said, we should investigate it further in case we can't provide a fix, although I'd like to share that this error is also being reported in the react-native-reanimated repository, and there's no workaround for it yet.
This issue might also be related to the following ones:
- https://github.com/wordpress-mobile/WordPress-Android/issues/16675
- https://github.com/WordPress/gutenberg/issues/41686
cc @geriux in case you could take a look at some point and/or provide further insights, thanks 🙇 !
Thank you all for triaging this! 🙇 If I can help in any way, just let me know.
cc @geriux in case you could take a look at some point and/or provide further insights, thanks 🙇 !
I'll check it out 👍
I was not able to reproduce this. I wondered whether localization could be a factor in this somehow, or characters being improperly handled during parsing, but I did not see a pattern by locale in Sentry 🤷♂️ , so I don't think that is a good hint.
One thing that could be a clue is that I did not see any events reported for Android 12, but did see events for Android 11, 10, 9, and 8.1.0. Perhaps something in the library code is using non-backward-compatible APIs without properly conditioning OS version?
I'm not able to reproduce this. I'm going to close this for now. It can always be opened if there are new instances found.