-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Release APK crash immediately on launch - React Native ( Version 0.58.4) #23352
Comments
I have the exact same issue and the same dependencies (versions). All works good in debug builds but release builds are crashing:
|
Disabling minification for release builds solved it for me:
|
@jassumgoran, this is already false. Not working. |
I have resolved this issue by using JSC build scripts for Android. Thanks to jsc-android. |
@ank26oct: Hi, I have the same issue, also since I upgraded to 0.58.x (from 0.57.3). But I have it on iOS, haven't tried Android yet. Does it work for you on iOS? Could you elaborate on the fix / what needs to be changed exactly? |
Same as you. Looking forward a correct solution. |
Just upgraded from 0.58.4 to 0.58.5, still the same issue unfortunately. |
React Native 0.59 will embed that JSC version, so unless someone can post a repro that uses 0.59 (meaning, a project init-ed to 0.59rc2 that still create the crash) there is no need to keep this open. Moreover, it really seems that it has something to do with the libraries you add, not React Native itself. Again, if you can post a repro for 0.59* I'll re-open. |
@ank26oct Do you know what exact library causes this problem? |
I've been debugging for hours, I have no clue what's causing it. |
@ank26oct It just works in emulator, not in real device. Could you post your solution here? |
Sorry for late reply. Its working both in emulator as well as in production build (real device). For this you have to install JSC build scripts for Android. You must use version r15c to build. r17 and above break NDK build that this app requires. Download the r15c NDK version here: https://developer.android.com/ndk/downloads/older_releases. and follow the installation requirements for JSC build scripts for Android. allprojects { and in Android i have made following changes in android/app/build.gradle project.ext.react = [ apply from: "../../node_modules/react-native/react.gradle" def enableSeparateBuildPerCPUArchitecture = false def enableProguardInReleaseBuilds = false android {
applicationVariants.all { variant -> dependencies { configurations.all { I hope this will help you. |
I am facing the same problem with RN 0.59.4. After installing react-native-admob and changing some dependencies I can compile but not run the app. But I can't use even in debug. What I should check ?
Any ideas ? plz... |
I'm getting these crashes with RN version 0.59.5 with APK, too. It works fine when building, but APK crashes right after opening the app. Can reproduce this on a real device (OnePlus 3, Android version 8.0.0), as well as on emulators (Pixel 3 XL with 64 bit Android 9.0 and Nexus 6P with Android 7.1.1). I can confirm that this is an issue even with a clean project created with react-native init. Other solutions mentioned here have not worked for me. |
@quietbits Seems to be related to #24260 |
Posting this here as well in the other related issue. Here is a repo with APK to try: https://github.com/quietbits/react-native-apk-crash. Any tests are much appreciated! |
I am having the same issue. RN version 0.57.8 |
solved when I moved from 0.59.0-rc.0 to 0.59.8 |
https://medium.com/@impaachu/react-native-android-release-build-crash-on-device-14f2c9eacf18 this post fixed my issue, but I skipped some steps. |
I found this issue #24261 with Hi-Pri tag. |
after generating the keystore run the following command "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" this worked for me |
Try to use |
I am having the same issue. RN version 0.60. |
This resolved my issue. |
@azharuddinkhan8898 its not working |
@chilugen Use this |
Upgrading from RN 0.59.5 to RN 0.59.10 worked for me. |
@ShaneMatthias me to 0.57.5 to 0.59.10 and this link https://react-native-community.github.io/upgrade-helper/?from=0.57.5&to=0.59.10 |
Updated to 0.59.10 but still not working just apk crash on start. I've tried every workaround but nothing any suggestion? |
delete node_modules folder reinstall npm i @LeonardoPlacanica |
Already tried at least 10 times. The app is building the release correctly but once i run the apk on a device it crashes at the start |
@LeonardoPlacanica some android folder code plz |
build.gradle on root project buildscript {
} allprojects { build.gradle in app folder import com.android.build.OutputFile /**
project.ext.react = [
] apply from: "../../node_modules/react-native/react.gradle" /**
/**
android {
} dependencies { // Run this once to be able to run the application with BUCK |
the same, any solution for help me!! |
Please try to use try catch in your function when you use another service |
I'm facing this after install react-native-firebase. This happens only on Android 8.0 by now. |
Thank you! It works for me! 🎉 |
best tip ever !
adding then |
🐛 Bug Report
The android version runs perfectly in debug mode using android studio emulator. However, the release version of the apk crashes immediately when launched.
To Reproduce
Steps to reproduce the behavior.
Reproducible Demo
After this Just install following:
rn-nodeify will create a shim.js in the project root directory
import './shim.js' file in aap.js
It runs perfectly in debug mode.
I have created signed apk it gets created without any error also installed without error but when i open, it crashes
Expected Behavior
The app should run without crashing.
App crashes on launch, logcat throws this error:
Code Example
Environment
Platform: Android
React Native Environment Info:
System: Windows 10
CPU: x64 Intel(R) Core(TM) i5- CPU M 520 @ 2.40GHz 2.39 GHz
Binaries:
Node : 8.11.3
npm: 6.4.1
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5014246
VS Code: 1.31.0
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.4 => 0.58.4
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
The text was updated successfully, but these errors were encountered: