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)
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
andx86_64
. When I remove them and work witharmeabi-v7a
andx86
the android app works fine. My app crashes as soon as I start going intoreact-navigation
and crashing inSamsung galaxy S7
havingAndroid Version 6.0.1
(it has both 64 bit OS and CPU) while working fine in most of the devices I have.Logcat Response:
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
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"
fromsolved 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 tryWhat, 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.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 belowIā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
andx86_64
frombuild.gradle
doesnāt change anything.Edit: added relevant bits from logcat ā¬ļø
@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 forarm64-v8a
,x86_64
, removing them frombuild.gradle
does not crash the app, which could potentially affect apps going live after1 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.