Description
- Review the documentation: https://facebook.github.io/react-native
- Search for existing issues: https://github.com/facebook/react-native/issues
- Use the latest React Native version: https://github.com/facebook/react-native/releases
- Run
react-native info
in your terminal and paste its contents under "Environment" - Let us know how to reproduce the issue. Include a code sample, share a project, or
share an app that reproduces the issue using https://snack.expo.io/
Environment
Environment:
OS: macOS High Sierra 10.13.4
Node: 10.3.0
Yarn: 1.7.0
npm: 6.1.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.1 AI-173.4720617
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4
Description
A quite precise kind of issue, that I basically found thanks to our manual testing team. It's quite the weird bug, caused by the GBoard only in Android env (tested on iOS without repro the issue).
The weirdest part is that not all emojis trigger it. In fact, aside night:
- "cat" 🐈 -> crash
- "rainbow" 🌈 -> crash
- "cloud" ☁️ -> no crash
- "sun" ⛅️ -> no crash
Btw there the words that 'trigger' emoji suggestions are different, the only one that triggers the same emoji on both platforms is "piano" 🎹 (and on iOS it doesn't crash, on Android yes) (ok maybe not the only one, but the only one I found quickly).
And it doesn't happen with remote debugger on.
Same stacktrace as #10756 and similar to #19129 (which was closed by the bot) and #18126 (which was closed linking to PR #18114 by @joshyhargreaves) by @hramos. So this is potentially a regression? (I am not sure, I feel like it's not strictly related to that one)
Steps to Reproduce
- clone the repo & cd into it
- react-native run-android
- make sure the device on which you run it has the Google GBoard installed
- tap on the textinput and write "night"
- the GBoard will suggest in the bar the night with stars emoji 🌃
- click on the suggestion
- crash
(the repro is the standard react-native init
project with a textinput just like the example in the docs)
Expected Behavior
The emoji appears without troubles in the textinput field.
Actual Behavior
App crashes with the following stacktrace:
Fatal Exception: java.lang.RuntimeException
Error calling RCTEventEmitter.receiveEvent
Caused by com.facebook.jni.CppException
Failed to create Value from JSON:
<...stacktrace>
If logging via LogCat, there are some extra info:
05-31 14:39:29.044 12953-13205/com.nightcrash I/ReactNativeJS: 'yo', 'Night'
05-31 14:39:30.163 12953-12953/com.nightcrash E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
05-31 14:39:30.197 12953-13205/com.nightcrash I/ReactNativeJS: 'yo', '🌃'
05-31 14:39:30.247 12953-13205/com.nightcrash E/unknown:ReactNative: Exception in native call
java.lang.RuntimeException: Error calling RCTEventEmitter.receiveEvent
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:762)
Caused by: com.facebook.jni.CppException: Failed to create Value from JSON:
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:762)