Closed bmbmjmdm closed 4 years ago
Thanks for the report. We're currently tracking this as one of the known issues for the 0.62 RC in https://github.com/react-native-community/releases/issues/157
It looks like this issue is still being reported up to RC5, but seems that
For those having issues with android builds or experiencing crashes, it its worth invalidating caches in android studio, this solved these issues I was having, so it may (or may not) also help others.
from @owinter86 may be the solution.
Have you been able to build this project with 0.61.5, i.e. is the problem introduced in 0.62?
@alloy Yes 0.61.5 was working fine for me.
Removing the iml-files and invalidating cache did not fix it.
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.
info Fetching system and libraries information...
System:
OS: macOS 10.15.3
CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
Memory: 3.27 GB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.19.0 - ~/.nvm/versions/node/v10.19.0/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v10.19.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 23, 26, 27, 28, 29
Build Tools: 26.0.3, 27.0.3, 28.0.2, 28.0.3, 29.0.2
System Images: android-22 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6241897
Xcode: 11.2.1/11B53 - /usr/bin/xcodebuild
npmPackages:
react: 16.11.0 => 16.11.0
react-native: 0.62.0-rc.5 => 0.62.0-rc.3
app/build.gradle
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 23
compileSdkVersion = 29
targetSdkVersion = 28
}
gradle.properties
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
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.
Not sure if it helps, but I've experienced a similar crash when bumping from 0.62.rc-2
to 0.62.rc-5
The crash didn't happen if I create a new project in 0.62.rc-5
from npx react-native init
It seems to crash around Flipper with the following log
--------- beginning of crash
03-09 23:17:15.919 8757 8785 E AndroidRuntime: FATAL EXCEPTION: FlipperConnectionThread
03-09 23:17:15.919 8757 8785 E AndroidRuntime: Process: com.rn062, PID: 8757
03-09 23:17:15.919 8757 8785 E AndroidRuntime: java.lang.NoClassDefFoundError: <clinit> failed for class com.facebook.flipper.android.EventBase; see exception in other thread
03-09 23:17:15.919 8757 8785 E AndroidRuntime: at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)
03-09 23:17:15.920 8757 8784 E AndroidRuntime: FATAL EXCEPTION: FlipperEventBaseThread
03-09 23:17:15.920 8757 8784 E AndroidRuntime: Process: com.rn062, PID: 8757
03-09 23:17:15.920 8757 8784 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfbjni.so
03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:789)
03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639)
03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)
03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary(NativeLoaderToSoLoaderDelegate.java:24)
03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:43)
03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.jni.HybridData.<clinit>(HybridData.java:34)
03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)
03-09 23:17:15.920 8757 8784 I Process : Sending signal. PID: 8757 SIG: 9
@Naturalclar I had the same crash after the same update. However, after running init
again for a fresh project, I ended up with a working app with exactly the same sources, so it seems to be purely an android caching issue.
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.
That said, if I open the project from Android Studio and build it from there, it works just fine... 😅
@kelset I’m new to Android/Java, but judging from your crash log it’s a different one from e.g. @Naturalclar. Yours appears to be about a lib being built for a different arch than the one you’re trying to run it on, whereas @Naturalclar’s appears to be about the loader not being able to find the lib in the first place.
@bmbmjmdm Can you update this issue with the results of removing all build/cache artefacts?
Tried invalidating cache via Android Studio, deleting all .iml files in ./android, ./android/app and ./android/.ide, deleting android/app/build files and ran a clean+build in Android Studio. Reran react-native bundle
and run-android
, getting white screen on launch, stack overflow in logs. This is still on rc-1.
[20:52:15] D | ReactNative ▶︎ ReactInstanceManager.ctor()
[20:52:15] D | ReactNative ▶︎ ReactInstanceManager.createReactContextInBackground()
│ ReactInstanceManager.recreateReactContextInBackgroundInner()
│ ReactInstanceManager.recreateReactContextInBackgroundFromBundleLoader()
│ ReactInstanceManager.recreateReactContextInBackground()
└ ReactInstanceManager.runCreateReactContextOnNewThread()
[20:52:15] D | ReactNative ▶︎ ReactInstanceManager.createReactContext()
[20:52:15] D | ReactNative ▶︎ Initializing React Xplat Bridge.
[20:52:15] D | ReactNative ▶︎ Initializing React Xplat Bridge before initializeBridge
[20:52:15] D | ReactNative ▶︎ Initializing React Xplat Bridge after initializeBridge
[20:52:15] D | ReactNative ▶︎ CatalystInstanceImpl.runJSBundle()
[20:52:15] D | ReactNative ▶︎ ReactInstanceManager.setupReactContext()
│ CatalystInstanceImpl.initialize()
└ ReactInstanceManager.attachRootViewToInstance()
[20:52:16] I | ReactNativeJS ▶︎ Running "wesleyapp" with {"rootTag":1}
[20:52:16] E | ReactNativeJS ▶︎ RangeError: Maximum call stack size exceeded.
then this repeated a bunch
2020-03-10` 19:56:36.303 30690-30714/? E/unknown:ReactNative: RangeError: Maximum call stack size exceeded., stack:
get@394:5662
addDep@394:15002
depend@394:4355
Being naive about Android builds, I’d venture to say it appears to be a pure JS issue. Can you try to find the call-site that leads to the exception and the code/libs involved? Even better would be a fresh sample app that has just the code to demonstrate the exception.
Btw, I see I didn’t mention this before, but @Naturalclar’s crash log is very different from @bmbmjmdm’s. @Naturalclar’s looks more similar to https://github.com/facebook/react-native/issues/28270, in that a lib can’t be found.
@alloy I can't say I fully understand that request, so I probably wouldn't be able to find that on my own
Yes, @Naturalclar issue seems similar to #28270, in that key libs (libjscexecutor.so, libfbjni.so) wasn't able to loaded.
For @bmbmjmdm's issue, could the issue perhaps be related to Vue Native?
@alloy I can't say I fully understand that request, so I probably wouldn't be able to find that on my own
Let me rephrase; in short I’m asking you to try to isolate the code in your application to the code that triggers this exception. I.e. start removing large parts of your codebase until the exception no longer occurs, which means the code you removed may contain the cause, then further dissect that code. Does that clarify things?
For @bmbmjmdm's issue, could the issue perhaps be related to Vue Native?
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?
Oh, good spot, hadn’t noticed that. I’m unfamiliar with it and to what extend it relies on RN internals.
I don't know a lot about Vue Native either but apparently it somehow transpiles Vue code to React Native, and so there could possibly be some incompatibility issues that happened in 0.62.0.
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
--------- beginning of crash 03-09 23:17:15.919 8757 8785 E AndroidRuntime: FATAL EXCEPTION: FlipperConnectionThread 03-09 23:17:15.919 8757 8785 E AndroidRuntime: Process: com.rn062, PID: 8757 03-09 23:17:15.919 8757 8785 E AndroidRuntime: java.lang.NoClassDefFoundError: <clinit> failed for class com.facebook.flipper.android.EventBase; see exception in other thread 03-09 23:17:15.919 8757 8785 E AndroidRuntime: at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: FATAL EXCEPTION: FlipperEventBaseThread 03-09 23:17:15.920 8757 8784 E AndroidRuntime: Process: com.rn062, PID: 8757 03-09 23:17:15.920 8757 8784 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfbjni.so 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:789) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary(NativeLoaderToSoLoaderDelegate.java:24) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:43) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.jni.HybridData.<clinit>(HybridData.java:34) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25) 03-09 23:17:15.920 8757 8784 I Process : Sending signal. PID: 8757 SIG: 9
Here is the full adb log of it below.
I experienced that with clean project on RC.5
version.
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:
Not sure if it helps, but I've experienced a similar crash when bumping from 0.62.rc-2 to 0.62.rc-5 The crash didn't happen if I create a new project in 0.62.rc-5 from npx react-native init
It seems to crash around Flipper with the following log
--------- beginning of crash 03-09 23:17:15.919 8757 8785 E AndroidRuntime: FATAL EXCEPTION: FlipperConnectionThread 03-09 23:17:15.919 8757 8785 E AndroidRuntime: Process: com.rn062, PID: 8757 03-09 23:17:15.919 8757 8785 E AndroidRuntime: java.lang.NoClassDefFoundError:
failed for class com.facebook.flipper.android.EventBase; see exception in other thread 03-09 23:17:15.919 8757 8785 E AndroidRuntime: at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: FATAL EXCEPTION: FlipperEventBaseThread 03-09 23:17:15.920 8757 8784 E AndroidRuntime: Process: com.rn062, PID: 8757 03-09 23:17:15.920 8757 8784 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfbjni.so 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:789) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary(NativeLoaderToSoLoaderDelegate.java:24) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:43) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.jni.HybridData. (HybridData.java:34) 03-09 23:17:15.920 8757 8784 E AndroidRuntime: at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25) 03-09 23:17:15.920 8757 8784 I Process : Sending signal. PID: 8757 SIG: 9 Here is the full adb log of it below.
I experienced that with clean project on RC.5 version.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/28163#issuecomment-601433753, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN4NBEWI4JQTOGJNSPKW6LRIKHUXANCNFSM4KZ6P5PQ .
@likern As mentioned earlier, the crash log that mentions the linker being unable to find libraries looks more like https://github.com/facebook/react-native/issues/28270
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.
Just posting to say I still need to look at this more; issue is not stale, life is just hectic
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
Can rule out bundle minify as the cause (I disabled minify for release and still got it). Today I'll be setting up a fresh project and adding all dependencies one by one to see if those are causing it.
Any help would be appreciated, been working on this project for so long and now I can't release for either platform :/
Are you able to attach a JS debugger to the app? I wonder if you would be able to set a breakpoint in one of those stack trace frames you reported (or perhaps just on any uncaught exception?) and then traverse the call stack to see if you can identify potential call sites that trigger the presumably recursive code.
Just double checking, still having a Flipper error on an old RC build? In that case I'd recommend to go to stable version first, so that we are talking about the same reference point. At least my memory won't be able to recall what issues might or might not exist in rc builds ;)
Hi thanks for the replies. After far too much debugging, it looks like this is a problem with the vuex store interacting with react-native animations. See https://github.com/GeekyAnts/vue-native-core/issues/263 for details
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
Confirmed this is fixed by https://github.com/GeekyAnts/vue-native-core/issues/118
Thanks everyone for the help!
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
Logs
When I build release bundle and deploy it, then the app installs and crashes immediately with the following logs:
ReactNativeJS ▶︎ RangeError: Maximum call stack size exceeded.
has a stack trace of