question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GBoard emoji crash

See original GitHub issue

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

  1. clone the repo & cd into it
  2. react-native run-android
  3. make sure the device on which you run it has the Google GBoard installed
  4. tap on the textinput and write “night”
  5. the GBoard will suggest in the bar the night with stars emoji 🌃
  6. click on the suggestion
  7. 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) 

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
kelsetcommented, May 31, 2018

Ok tested the PR locally, and I can confirm it fixes this issue. As soon as a new react-native release includes that commit I’ll close this issue.

1reaction
malonguwacommented, Jun 25, 2018

@hramos is that possible you can cherry pick this commit (https://github.com/facebook/react-native/commit/41975f75d96ef4b606b4618461bf24d5db063b77) into the 0.55 release? I am not quite understand how to change my local react native android native java file… and do not quite want to upgrade to the 0.56 just for this one issue currently in my project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Fixed] Gboard emoji button crashing app for some after iOS ...
Gboard users are reporting that the app crashes when using emoji button, GIF or sticker search after the iOS 15.2 update.
Read more >
Fix: Gboard Is Crashing on iPhone - AppleToolBox
The update packs useful bug fixes for GIF and emoji crashes, as well as stability improvements. Disable Full Access. Launch the Gboard app...
Read more >
Gboard on ios - gif and sticker search crash - Reddit
Press and hold the emoji button, then select emojis on the pop-up. This fixes the emoji button. Gifs still crash the keyboard though....
Read more >
Gboard Emoji, GIF, Stickers Crashing after iOS 15.2 update
In this tutorial, we will show you how to fix the Gboard Emoji, GIF, and Sticker crashing issue after updating iPhone to iOS...
Read more >
How to Fix Gboard Keeps Crashing on iOS & Android? - iToolab
Use these TOP solutions to fix Gboard keeps crashing on iPhone and Android ... Google Translate, GIFs, emoji search, glide typing etc.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found