react-native: 0.62-RC: Release version instacrash on Android
Overview
I am able to run my app perfectly fine with react-native run-android
after creating a dev bundle.
However when I try to run react-native run-android --variant=release
after creating a release bundle, the app crashes immediately when started.
Bundle command being used for release: react-native bundle --platform android --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle
React Native version:
System: OS: Windows 10 10.0.18362 CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor Memory: 7.01 GB / 15.93 GB Binaries: Node: 10.16.2 - C:\Program Files\nodejs\node.EXE npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 3.4.0.0 AI-183.6156.11.34.5692245 npmPackages: react: 16.11.0 => 16.11.0 react-native: 0.62.0-rc.1 => 0.62.0-rc.1
Package.json
{
"name": "wesleyapp",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@babel/runtime": "^7.7.7",
"react": "16.11.0",
"react-native": "0.62.0-rc.1",
"react-native-audio": "^4.3.0",
"react-native-image-picker": "^1.1.0",
"react-native-sound": "^0.11.0",
"react-native-tts": "^3.0.0",
"vue-native-core": "0.0.8",
"vue-native-helper": "0.0.11",
"vuex": "^3.1.1"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.11.0",
"vue-native-scripts": "0.0.16"
},
"jest": {
"preset": "react-native"
}
}
Logs
When I build release bundle and deploy it, then the app installs and crashes immediately with the following logs:
[21:38:37] D | ReactNative ▶︎ ReactInstanceManager.ctor()
[21:38:37] D | ReactNative ▶︎ ReactInstanceManager.createReactContextInBackground()
└ ReactInstanceManager.recreateReactContextInBackgroundInner()
[21:38:37] D | ReactNative ▶︎ ReactInstanceManager.recreateReactContextInBackgroundFromBundleLoader()
│ ReactInstanceManager.recreateReactContextInBackground()
└ ReactInstanceManager.runCreateReactContextOnNewThread()
[21:38:37] D | ReactNative ▶︎ ReactInstanceManager.createReactContext()
[21:38:37] D | ReactNative ▶︎ Initializing React Xplat Bridge.
[21:38:37] D | ReactNative ▶︎ Initializing React Xplat Bridge before initializeBridge
[21:38:37] D | ReactNative ▶︎ Initializing React Xplat Bridge after initializeBridge
└ CatalystInstanceImpl.runJSBundle()
[21:38:37] D | ReactNative ▶︎ ReactInstanceManager.setupReactContext()
[21:38:37] D | ReactNative ▶︎ CatalystInstanceImpl.initialize()
[21:38:37] D | ReactNative ▶︎ ReactInstanceManager.attachRootViewToInstance()
[21:38:37] D | ReactNative ▶︎ ReactInstanceManager.createReactContextInBackground()
[21:38:37] D | ReactNative ▶︎ ReactInstanceManager.attachRootViewToInstance()
[21:38:38] I | ReactNativeJS ▶︎ Running "wesleyapp" with {"rootTag":1}
[21:38:38] E | ReactNativeJS ▶︎ RangeError: Maximum call stack size exceeded.
ReactNativeJS ▶︎ RangeError: Maximum call stack size exceeded.
has a stack trace of
get
index.android.bundle:394:5662
addDep
index.android.bundle:394:15002
depend
index.android.bundle:394:4355
get
index.android.bundle:394:5662
...
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 31 (14 by maintainers)
Whoops, got stuck with this issue and wasted a lot of time. I found the fix for this. Thanks to @jaythummar95, he told me run the following command:
cd android/
Run
./gradlew clean
That should probably fix this.
I’m going to confirm this issue is addressed in https://github.com/GeekyAnts/vue-native-core/issues/118 and if so, I’ll close it
Just posting to say I still need to look at this more; issue is not stale, life is just hectic
Not sure if it helps, but I’ve experienced a similar crash when bumping from
0.62.rc-2
to0.62.rc-5
The crash didn’t happen if I create a new project in0.62.rc-5
fromnpx react-native init
It seems to crash around Flipper with the following log
Here is the full adb log of it below.
Update: I have put down Android for a while to focus on iOS. Upon building a release build in iOS, I see the same error there! (Note: debug build runs fine for both operating systems)
Therefore this is not a problem with Android Studio or cache, I believe
Make sure to clear the android caches. If that doesn’t help check for differences between the freshly gradle file and the one the updated project.
On Thu, Mar 19, 2020 at 9:51 PM Victor Malov notifications@github.com wrote:
Oh, good spot, hadn’t noticed that. I’m unfamiliar with it and to what extend it relies on RN internals.
@bmbmjmdm Perhaps see if a new application made with RC5 works well with Vue Native?
I’m experiencing the same crash after generating a fresh app via
npx react-native init RN062 --version 0.62.0-rc.5
on a completely fresh machine 😅So yeah I don’t really understand what’s going on… since I don’t have any pre-existing cache.
Error log:
Error log:
That said, if I open the project from Android Studio and build it from there, it works just fine… 😅
My issue seems to be unrelated to this one.
It seems to be related to ProGuard, as I get it to work without it. I’ll investigate more.
Invalidating the caches solved the issue on my end, deleting the build folder was not enough in these cases. This was a direct upgrade from 61.5, to RRC.3 and RC.5.
Both hermes enabled and disabled work, both on my machine and external CI.
My config is slightly different to the RN init, due to various third party packages, I have dumped my info below, it may help others debug their issues.
I am happy to add anything else if people need to compare.
app/build.gradle
gradle.properties
@alloy Yes 0.61.5 was working fine for me.
Removing the iml-files and invalidating cache did not fix it.
It looks like this issue is still being reported up to RC5, but seems that
from @owinter86 may be the solution.