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.

TextInput crashes an app if Samsung Keyboard uses Predictive Text & Suggest text corrections

See original GitHub issue

Description

Main issue: Generated release .apk TextInput crash the app on Samsung when Predictive Text & Suggest text corrections is activated. React-native versions checked: 0.63.3, 0.67.2 Phones produced the issue: Samsung S20 Ultra, Samsung Galaxy S21 Plus Another possible issue: For all the crashes captured some parts of the text were underlined green or red, maybe the issue is with that suggestions… It was first produced by the production project based on 0.63.3v, then I created bare 0.67.2v project and added simple TextInput, and the issue still exists. Attaching a video so everybody can replicate.

Screenshot_20220216-094239_Samsung_Keyboard

https://user-images.githubusercontent.com/48454610/154644390-61bdd58c-e647-422d-b69b-c26dda88e721.mp4

Version

0.63.3, 0.67.2

Output of npx react-native info

System: OS: macOS 12.2.1 CPU: (8) arm64 Apple M1 Memory: 439.56 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 17.2.0 - /opt/homebrew/bin/node Yarn: 1.22.17 - /opt/homebrew/bin/yarn npm: 8.1.2 - /usr/local/bin/npm Watchman: 2021.12.13.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: API Levels: 29, 30, 32 Build Tools: 28.0.3, 29.0.2, 30.0.0, 30.0.2, 32.0.0 System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play ARM 64 v8a, android-31 | Google APIs ARM 64 v8a, android-32 | Google APIs ARM 64 v8a, android-32 | Google APIs Intel x86 Atom_64 Android NDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7935034 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 1.8.0_292 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.67.2 => 0.67.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

  1. Get my repo: https://github.com/BohdanSol/projectTwo
  2. yarn install
  3. Generate keystore, put it inside android>app. Change values regarding keystore inside gradlew.properties
  4. From root cd android && ./gradlew assembleRelease
  5. Test generated apk in real device

Snack, code example, screenshot, or link to a repository

https://github.com/BohdanSol/projectTwo

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:8
  • Comments:49

github_iconTop GitHub Comments

6reactions
JuanAlejandrocommented, Mar 16, 2022

We were able to reproduce this bug and we found that setting autoCorrect to false in the TextInput solves the issue. We are planning to roll out this soon and expect ANR numbers to go down. I’ll keep you posted.

Try this and let me know if it works for you.

P.S.: Since this is happening only for Samsung devices with Android 12 I made this util to only set autoCorrect to false when the device meets these props:

import { toLower } from 'lodash';
import { getSystemVersion, useManufacturer } from 'react-native-device-info';

export const useIsSamsungWithAndroid12 = (): boolean => {
  const { loading, result } = useManufacturer();
  const systemVersion = getSystemVersion();

  return !loading && toLower(result) === 'samsung' && systemVersion.startsWith('12');
};
4reactions
efstathiosntonascommented, Oct 17, 2022

Hey fellow devs, please upvote the comment under the Meta discussion about what to improve: https://github.com/react-native-community/discussions-and-proposals/discussions/528#discussioncomment-3890273

let’s hope it will get enough attention

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I personalise and turn predictive text on ... - Samsung
Predictive text suggests words as you type on your Samsung Galaxy device. Learn how to turn it on and off as well as...
Read more >
Crash on Samsung devices due to TextInput : r/reactnative
Been seeing a lot of Firebase Crashlytics events on crashes related ... It's an issue with samsung stupid keyboard predictive/autocorrect, ...
Read more >
Gboard – the Google Keyboard on the App Store
Having said that this keyboard has the most accurate swipe type keyboard and predictive text suggestions!!!! Will rate 5 stars when some features...
Read more >
Optimize your app for autofill - Android Developers
The autofill framework saves user input for future use by showing a "Save for autofill?" dialog after the autofill context is finished.
Read more >
Android keyboard wont type certain letters - Caritas Castellaneta
When you are using the keyboard of iPhone and it just freezes or becomes ... The cause of this issue is the Predictive...
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