Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React native 0.59.x crashes on Android without any error message #24260

Closed
mmahdigh opened this issue Apr 2, 2019 · 95 comments
Closed

React native 0.59.x crashes on Android without any error message #24260

mmahdigh opened this issue Apr 2, 2019 · 95 comments
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@mmahdigh
Copy link

mmahdigh commented Apr 2, 2019

🐛 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(R) Core(TM) 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

@react-native-bot react-native-bot added the Platform: Android Android applications. label Apr 2, 2019
@compojoom
Copy link
Contributor

@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.

@mmahdigh
Copy link
Author

mmahdigh commented Apr 2, 2019

@compojoom actually I did look at output of logcat but I couldn't find anything useful there.
here is a screenshot:
command

@zaguiini
Copy link

zaguiini commented Apr 2, 2019

Try to print the logs without filtering them

@mmahdigh
Copy link
Author

mmahdigh commented Apr 2, 2019

@zaguiini What do you mean? (if you mean I should have run just log-android , I did and the output was exactly similar to the screenshot provided in my previous comment)

@zaguiini
Copy link

zaguiini commented Apr 2, 2019

Run adb logcat instead, give it a try

@mmahdigh
Copy link
Author

mmahdigh commented Apr 2, 2019

@zaguiini Hundreds of lines of text were logged but there wasn't anything useful or special. could you reproduce this issue on your own machine or it's something that I'm just facing on my device?

@zaguiini
Copy link

zaguiini commented Apr 2, 2019

I'm not getting this error, unfortunately...

@ishantsagar
Copy link

ishantsagar commented Apr 3, 2019

@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

@zaguiini
Copy link

zaguiini commented Apr 4, 2019

@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

Looks like there's a yoga issue there?

@compojoom
Copy link
Contributor

Can you guys try with a clean rn project? Is it working there? If it is, then it is a misconfiguration with the project you have. We are running with rn .59 for a week now and have 0 crash reports.

@cpojer
Copy link
Contributor

cpojer commented Apr 4, 2019

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!

@cpojer cpojer closed this as completed Apr 4, 2019
@mmahdigh
Copy link
Author

mmahdigh commented Apr 4, 2019

@compojoom as I said, it's reproducible just by creating a fresh RN project. maybe it's just reproducible on Windows machines or android 7.0 or maybe just physical Galaxy S7. all I know is that I didn't have this issue on 0.58.6 or Expo SDK 32.
@cpojer I'm not seeking help for a special feature or implementation of something! there is clearly something wrong with the RN itself that it crashes without any error (or logs) whatsoever!

@compojoom
Copy link
Contributor

@MahdiGhajary - then do rn init, create the project, push it to github, give us a link and we'll try to run your project to confirm. RN init works fine on my end and the produced app doesn't crash.

@ishantsagar
Copy link

ishantsagar commented Apr 6, 2019

@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.

@nahidmbstu
Copy link

mine does not crash....tested with latest version

@pesaorus
Copy link

pesaorus commented Apr 6, 2019

Crashes on physical galaxy s7.

@ishantsagar
Copy link

@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?

@Fouppy
Copy link

Fouppy commented Apr 13, 2019

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}

@mmahdigh
Copy link
Author

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

@wbercx
Copy link

wbercx commented Apr 15, 2019

@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.

@Fouppy
Copy link

Fouppy commented Apr 15, 2019

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

@ahanriat
Copy link
Contributor

Important note: As described on this StackOverflow solution, just removing "arm64-v8a", "x86_64" is not enough, you also have to do this in your ndk filters:

android {
    defaultConfig {

        ndk {
            // Specifies the ABI configurations of your native
            // libraries Gradle should build and package with your APK.
            abiFilters "armeabi-v7a", "x86"
        }
       ...
    }
}

@Fouppy
Copy link

Fouppy commented Apr 29, 2019

@ahanriat Yep, that's what I did :) To no avail.

@ghost
Copy link

ghost commented Apr 30, 2019

Got the same crash using latest react-native, and fresco version 1.13.0. Downgrading Fresco to 1.9.0 resolved the issue to me, and it doesn't crash anymore.

@rizrmd
Copy link

rizrmd commented May 1, 2019

Got the same crash using latest react-native, and fresco version 1.13.0. Downgrading Fresco to 1.9.0 resolved the issue to me, and it doesn't crash anymore.

How did you downgrade fresco version ? what file should I change ?

@ru55ell
Copy link

ru55ell commented May 2, 2019

This is an issue for me too.

@jacquesdev
Copy link

@chilugen - just upgrading doesn't work for all Android devices.

@chilugen
Copy link

@jacquesdev what error ?

@jacquesdev
Copy link

@chilugen React native 0.59.x crashes on Android

@chilugen
Copy link

@jacquesdev
Copy link

jacquesdev commented Sep 13, 2019

@chilugen - I am on that version, see the comment above, #24260 (comment), 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
Copy link

j-wang commented Sep 13, 2019

@jacquesdev Yup, since the comment, I've seen some folks do that with v8, and it looks like it's working for them too. I can't speak from personal experience since I used Hermes (which does require an upgrade).

@tal987
Copy link

tal987 commented Sep 13, 2019

@j-wang I’m using Hermes too but it seems that the performance is very slow compare to without it. Anyway I upgraded to 0.60.5 and I have noticed that the performance is slower than before. Did you fix this issue?

@j-wang
Copy link

j-wang commented Sep 13, 2019

Hmm, it likely depends on your exact application and what you're doing. For ours, it's actually marginally faster. Well, on production at least. On development, it's now almost unusably slow for certain phones (including higher-end ones).

@RenanSanguinete
Copy link

I have two apps, one at react native 0.59.10 and the other at 0.60.5. I can't use Hermes or v8 cause there is a lib (realm in this case) that only uses JavaScript Core. The problem for me is that I can't go back cause of Google 64 bits mandatory. Waiting for the lib owners to integrate Hermes or V8, and hoping that this will solve those crashes.

I already tried so many things, and change this lib will affect the whole project, at a level that will the worth for me to create a new one instead.

@wkoutre
Copy link

wkoutre commented Sep 20, 2019

@RenanSanguinete You can build for 64-bit on 0.59.x

@RenanSanguinete
Copy link

@wkoutre The app still crashes on 64-bits on 0.59.x in some devices as Galaxy Samsung S7

@wkoutre
Copy link

wkoutre commented Sep 23, 2019

Well, it didn't for the app I'm currently working on, but there are obviously many complexities to consider regarding this on a per-app basis.

@ezequiel1988
Copy link

still the error persists in samsung s7 with RN 0.59?

@DaSemicolon
Copy link

I'm on RN 0.60 and still having the issue.

@thekunalmaheshwari
Copy link

I am also facing the same issue across for all android 6.0 version. not for lower ones and higher ones

@maheshatti89
Copy link

Hi My app is crashing only in production build
TextInput 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.
i am using react -native 0.59.4.
also using redux-form fields for text input.
Please help me to solve this issue.
@mmahdigh Can you help me out on this issue if your issue is fixed.?

@thekunalmaheshwari
Copy link

I was able to fix for my app using kind of a workaround. used
android:hardwareAccelerated="true"
in the AndroidManifest.xml for Application tag.

@seosgithub
Copy link

Here's a fix if your issues are related to JSC on React 0.59 (#24261 (comment))

@art1373
Copy link

art1373 commented Jan 18, 2020

react 61.4 still crashes on random devices. (huawei and Lg mostly)

@TRIPTI-JAIN
Copy link

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

@Hitesh80
Copy link

Hitesh80 commented Feb 3, 2020

Update the react version to react 61.5 ..then it will work fine

@ghena
Copy link

ghena commented Feb 10, 2020

I have an error using
gradlew bundleRelease with react native 61.5

Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
error Unable to resolve module ../components/AppStateListener from screens\WebScreen.js:

seems that the bundle is not able to read the component ?

The error is the same using:
react-native bundle --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

Please help.

@Loown
Copy link

Loown commented Feb 20, 2020

I'm in 61.5 still crashing.

@Ayomide57
Copy link

Ayomide57 commented Feb 24, 2020

i faced the same issue
i try to check the begining of crash log: adb logcat -d
then i saw this error message:
AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;
i solved it using this link
https://stackoverflow.com/questions/56901873/swiperefreshlayout-error-on-a-react-native-app-after-androidx-migration
i hope this help

@gnramaganga
Copy link

gnramaganga commented Feb 25, 2020

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

@quangcanh2975
Copy link

@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

Thanks. It worked in my case

@GIRIRAJNAGAR768
Copy link

two easy steps solved my problem...

open android studio and remove offline bundle from src/main/assest..(** if any)
open MainApplication.java and remove the following import..
import com.facebook.react.BuildConfig

@facebook facebook locked as resolved and limited conversation to collaborators Apr 4, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests