react-native: React native 0.59.x crashes on Android without any error message

šŸ› Bug Report

RN 0.59 isnā€™t stable on Android. if you spend 20 seconds wandering around in your app, it will crash and stop working with no error message whatsoever. I have to add I didnā€™t face this issue on Expo SDK 32 or RN v0.58.6.

To Reproduce

react-native init react-native run-android and use the Code Example as your App class. now just type a few words in TextInput and then remove some letters and again type somethingā€¦; it takes less than 5 seconds to crash without any error message.

Expected Behavior

just to work in a stable manner.

Code Example

export default class App extends Component {
  state = { text: "" };

  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>Welcome to React Native!</Text>
        <Text style={styles.instructions}>To get started, edit App.js</Text>
        <Text style={styles.instructions}>{instructions}</Text>
        <TextInput
          onChangeText={text => {
            this.setState({ text });
          }}
          value={this.state.text}
          placeholder="please don't crash!"
        />
      </View>
    );
  }
}

Environment

React Native Environment Info: System: OS: Windows 10 CPU: (8) x64 IntelĀ® Coreā„¢ i7-4702MQ CPU @ 2.20GHz Memory: 913.58 MB / 5.76 GB Binaries: npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5056338

Android 7.0 (real device: Samsung S7) React Native v0.59.3

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 26
  • Comments: 95 (6 by maintainers)

Most upvoted comments

Please note this issue tracker is not a help forum (as stated in issue template).

We recommend using StackOverflow where there are community incentives to help others or our Discord channel for questions. We can reopen this once there is a concrete bug report and this is a real issue, or even better: please send us a PR with a fix!

It seems all they care is closing issues and keeping them below 400 even though lots of them are still relevant. @Fouppy

@compojoom I am also experiencing this issue in android after I have migrated to RN 0.59 and added abi filters to support for 64bit android support arm64-v8a and x86_64. When I remove them and work with armeabi-v7a and x86 the android app works fine. My app crashes as soon as I start going into react-navigation and crashing in Samsung galaxy S7 having Android Version 6.0.1(it has both 64 bit OS and CPU) while working fine in most of the devices I have.

Logcat Response: crash_1

Same issue is coming after I try it with a fresh RN project with v0.59

Crashes on physical galaxy s7.

This problem may be related to react-native-screens. Please try. It worked for me.

Add the following two lines to the dependencies section in android/app/build.gradle.

implementation ā€˜androidx.appcompat:appcompat:1.1.0-rc01ā€™ implementation ā€˜androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02ā€™

https://stackoverflow.com/questions/56901873/swiperefreshlayout-error-on-a-react-native-app-after-androidx-migration

@hramos @mkonicek As of now we can conclude that this seems to be an issue with latest RN 0.59 release, affecting android builds running on Samsung S7, S7 Edge after we provided support for arm64-v8a, x86_64, removing them from build.gradle does not crash the app, which could potentially affect apps going live after 1 August 2019 as per Google Play 64 bit support policy. We would like you guys to draw some attention to it, please?

I agree with @ishantsagar , I have just faced this issue, only happens on REAL DEVICE, LENOVO A701a48, RUNNING ANDROID 6. deleting "arm64-v8a", "x86_64" from

ndk {
            abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
 }

solved the issue.

So it must be something to do with this latest configā€™s way of building ā€œarm64-v8aā€, ā€œx86_64ā€ builds. Not sure if itā€™s entirely RNā€™s fault, but maybe the team could help investigate and educate instead of just closing the case for the sake of closing it

Iā€™m on RN 0.60 and still having the issue.

In my case app (0.59.9 version) was crashing just after opening it. I resolved by doing this:

react-native bundle --dev false --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

cd android

./gradlew assembleRelease

This will create an unrelease APK in android/app/build/outputs/apk/release

Run adb logcat instead, give it a try

What, why is this closed ? is this resolved ?

@compojoom @cpojer @MahdiGhajary Git Repo: https://github.com/ishantsagar/RN59-AwesomProject Crash Video: https://www.dropbox.com/s/opc1vwgusi4ck88/samsung_crash.mp4?dl=0 Device Details: https://www.dropbox.com/s/b39yvmobhjsx2be/Screenshot_20190406-140655.png?dl=0 https://www.dropbox.com/s/p201120ov4xeb7v/Screenshot_20190406-140633.png?dl=0 https://www.dropbox.com/s/xlz7n0xmu894uoi/Screenshot_20190406-140644.png?dl=0

The crash is occurring when I open the app and long press on the text for 2-3 seconds, sometimes the app hangs up but doesnā€™t crash.

As mentioned earlier as well, the app is not crashing in other android devices as I noticed till now, that is why it could be related to some specific device architecture configuration.Crash log is the same as attached previously.

Note: However, app does not crash in debugger mode.

@hramos @mkonicek As of now we can conclude that this seems to be an issue with latest RN 0.59 release, affecting android builds running on Samsung S7, S7 Edge after we provided support for arm64-v8a, x86_64, removing them from build.gradle does not crash the app, which could potentially affect apps going live after 1 August 2019 as per Google Play 64 bit support policy. We would like you guys to draw some attention to it, please?

I agree with @ishantsagar , I have just faced this issue, only happens on REAL DEVICE, LENOVO A701a48, RUNNING ANDROID 6. deleting "arm64-v8a", "x86_64" from

ndk {
            abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
 }

solved the issue.

So it must be something to do with this latest configā€™s way of building ā€œarm64-v8aā€, ā€œx86_64ā€ builds. Not sure if itā€™s entirely RNā€™s fault, but maybe the team could help investigate and educate instead of just closing the case for the sake of closing it

it fixed the crash only but as google has upgrade 64-bit policy on 1 August 2019, we can not submit our application on the play store when we upload .apk file on the play store, it give the error below Screenshot 2019-08-14 at 08 08 39

Iā€™m pretty sure this is a duplicate of this issue https://github.com/facebook/react-native/issues/24261

TLDR; Javascript Core Jit on Android 64bits is not stable šŸ› But thanks to some awesome people ā¤ļø a fix is coming

This is still happening on RN 59.4, Galaxy S7, Android 6.0.

Removing arm64-v8a and x86_64 from build.gradle doesnā€™t change anything.

Edit: added relevant bits from logcat ā¬‡ļø

04-12 12:49:51.781 32678   340 D SoLoader: libimagepipeline.so not found on /data/data/com.example.app/lib-main
04-12 12:49:51.781 32678   340 D SoLoader: libimagepipeline.so found on /data/app/com.example.app-1/lib/arm64
04-12 12:49:51.911 32678   345 W System.err: remove failed: ENOENT (No such file or directory) : /data/user/0/com.example.app/cache/http-cache/journal.tmp
04-12 12:50:00.391 23531 23531 I AndroidIME: DummyIme.onActivate() : EditorInfo = Package = com.example.app : Type = PhoneNumber : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Hide : NoPersonalizedLearning = Disable
04-12 12:50:00.401 23531 23531 I Conv2QueryExtension: Conv2Query not enabled due to current app [com.example.app] not in whitelist
04-12 12:50:00.671  3159  3159 F DEBUG   : pid: 32678, tid: 32756, name: mqt_js  >>> com.example.app <<<
04-12 12:50:00.731  3159  3159 F DEBUG   :     #00 pc 00000000007e048c  /data/app/com.example.app-1/lib/arm64/libjsc.so (WTFCrash+16)
04-12 12:50:00.731  3159  3159 F DEBUG   :     #01 pc 00000000000be650  /data/app/com.example.app-1/lib/arm64/libjsc.so (WTFCrashWithInfo(int, char const*, char const*, int)+24)
04-12 12:50:00.731  3159  3159 F DEBUG   :     #02 pc 0000000000489f2c  /data/app/com.example.app-1/lib/arm64/libjsc.so (operationLinkDirectCall+1120)
04-12 12:50:01.411  3470   360 W ActivityManager:   Force finishing activity com.example.app/.MainActivity
04-12 12:50:01.521  3470  3580 D ISSUE_DEBUG: InputChannelName : fc4da6f Application Error: com.example.app
04-12 12:50:01.571  3470  4337 I WindowState: WIN DEATH: Window{70135df u0 d0 com.example.app/com.example.app.MainActivity}

@lecramfriedrich See https://github.com/facebook/react-native/issues/25494

Libraries in general (Fresco, React navigation, whatever else) have come up in these different issues as ā€œremove this and it will fix itā€ and as a whole the consensus is removing any/all donā€™t help. One of the issues of tracking this down is removing the libraries may look like it temporarily works, because the cause of the crash is not necessarily deterministic. Itā€™s a garbage collection issue with Android + JSC, so sometimes you can actually go for a long time (from luck) without crashing.

Using an abi filter to remove 64-bit builds doesā€¦ well, in most casesā€¦ but is no longer viable given the Google Play Store no longer accepts apps that donā€™t contain 64-bit builds as of August 1st.

0.59.10 helps somewhat, but still encounters crashes.

The current most likely path for fixing this is to upgrade to 0.60+ and Hermes, as per the other issue.

@hramos @mkonicek As of now we can conclude that this seems to be an issue with latest RN 0.59 release, affecting android builds running on Samsung S7, S7 Edge after we provided support for arm64-v8a, x86_64, removing them from build.gradle does not crash the app, which could potentially affect apps going live after 1 August 2019 as per Google Play 64 bit support policy. We would like you guys to draw some attention to it, please?

update .aab file instead of apk. its works for me cd android ./gradlew bundleRelease

I actually went through the trouble of bumping React-Native to 0.60.5 and enabling Hermes + 64-bit (which was a pain, as upgrading react-native always is) and Iā€™m still having these issues on several Android phones (including HUAWEI MYA-L41).

Iā€™ve tried just about everything Iā€™ve found in other threads without much luck, so I can tell you bumping react-native and using Hermes doesnā€™t fix all of these issues.

The updated react-native + Hermes and 64-bit is amazing on other Android devices Iā€™ve ran it on and our app has never felt smoother.

However, whenever I test on the specific device I mentioned (Huawei) it crashes instantly or after the app is open for 1-2 seconds without a specific crash message, I donā€™t have any other devices besides that one and a newer Huawei (which works perfectly) so I canā€™t give you more info on other phones.

If anyone has made any progress with this issue or has any ideas for more specifically logging my issues, advice is always welcome and Iā€™m willing to share any information regarding this issue. Thanks to the people in this thread for offering solutions, but no luck so far. šŸ™‚

For anyone reading this, the summary is there is no fix for 0.59x. You will have to upgrade to 0.60x, switch on hermes, and then if there are any other issues after this you will have to create a new issue with the repo

if i use below app crashes and accepted by google play store ndk { abiFilters ā€œarmeabi-v7aā€,ā€œarm64-v8aā€,ā€œx86ā€,ā€œx86_64ā€ } if i use below app is working but not accepted by google play store ndk { abiFilters ā€œarmeabi-v7aā€, ā€œx86ā€ }

please any one help me solving

Iā€™m also getting this issue on Android. Any update on this?

@cpojer Repo with source (RN 0.59.8 react-native clean init project with no edits) and APK file (inside /apk folder) is here: https://github.com/quietbits/react-native-apk-crash Could you (and anyone else) please try it on your device(s) and see if you can successfully launch it? There is a list of devices weā€™ve tried in the readme. Much appreciated!

@Fouppy That still mentions arm64 throughout the stack trace. Did you fully rebuild the app after removing those ABIs from build.gradle?

The 64 bit build appears to be causing all sorts of issues for us. From segfaults to seemingly random NullPointerExceptions that never occurred before and cannot be reproduced, specifically on Galaxy S7 and Galaxy Tab S2. Both device variants run on Cortex-A53 (Exynos) CPUs.

Iā€™m not getting this error, unfortunatelyā€¦

Hereā€™s a fix if your issues are related to JSC on React 0.59 (https://github.com/facebook/react-native/issues/24261#issuecomment-548149232)

@chilugen - I am on that version, see the comment above, https://github.com/facebook/react-native/issues/24260#issuecomment-526319471, itā€™s not even fixed yet in 0.60.5.

For sure upgrading to 0.59.10 will fix it on some Android phones, but not all of them.

@j-wang - Itā€™s possible to switch to v8 without upgrading to rn 0.60

@tal987 No, it will 100% not work in 0.60.5, as tested by myself and at least 10 other people spread across different issues and confirmed by maintainers of RN and related libraries (at least conceptually while trying to pin down the cause of the issue).

Again, this is a nondeterministic crash, so itā€™s really hard to tell for certain without a long runtime across thousands of devices. But thatā€™s what weā€™ve done.

You will need to upgrade AND switch out your JavaScript engine to v8 or Hermes, as referenced in the other issue.

I found this issue #24261 with Hi-Pri tag.

This is an issue for me too.

@ahanriat Yep, thatā€™s what I did šŸ˜ƒ To no avail.

@wbercx This logcat was extracted before, but the crash still occured

@MahdiGhajary - if you look into the output of logcat youā€™ll most probably see the exact reason for the crash. There is no such thing ā€œno error messageā€. We have our app running on .59 and it works fine. If you want someone to help you - please provide the output of the crash report in logcat.