Crash on Android when enabling debug mode
Description
With a regular React Native app, when enabling JS Debug mode the app is crashing. When I remove reanimated dependency and recompile the app it works fine. Similar issue https://github.com/facebook/react-native/issues/31379.
java.lang.AssertionError: No source URL loaded, have you initialised the instance?
at com.facebook.infer.annotation.Assertions.assertNotNull(Assertions.java:19)
I've seen a potential fix in #1282 but it does not seem to help.
Expected behavior
JS Debug mode does not crash.
Snack or minimal code example
- Try enabling debug mode in a bare RN 0.64.0 app.
Package versions
- React Native: 0.64.0
- React Native Reanimated: 2.1.0
- NodeJS: 15
- Xcode: 12.5
- Java & Gradle: JDK11, gradle 6.9-rc.1
Affected platforms
- [x] Android
- [ ] iOS
- [ ] Web
Issue validator
The issue is invalid!
- Section required but not found: actual behavior & steps to reproduce(for label 🐞 bug)
This is expected, you can't use remote debugging with turbomodules (which Reanimated v2 is using). Check out Flipper to debug your app.
https://docs.swmansion.com/react-native-reanimated/docs/#known-problems-and-limitations
@jakub-gonet - what if you're using jsc instead of hermes and not using any of the reanimated 2 apis?
I'm using Expo 41 Bare with JSC, my app does not use Reanimated 2 and I have this issue.
Using React-Navigation 4.x, depending on Reanimated v1, so don't think I'm using any Reanimated 2 APIs
I can't really remove the Reanimated deps as RNav is using it, and not sure it's possible to use Hermes/Flipper with Expo 41 bare yet
@slorber - it is possible to use hermes and flipper but it's not yet compatible with expo-updates
@jakub-gonet - what if you're using jsc instead of hermes and not using any of the reanimated 2 apis?
AFAIK @piaskowyk is working on this problem, maybe he can chime in.
looked into this problem today and this is my finding: TL;DR: it is truly a limitation, please use hermes and hermes inspector instead.
in react native remote debugging mode, the JSI runtime will not be created. reanimated will crash during installJSIBindings for accessing null pointer. (runtime_ is null)
https://github.com/software-mansion/react-native-reanimated/blob/9a71f34d19318f438f507817ddb108dd49972b0c/android/src/main/cpp/NativeProxy.cpp#L148-L151
we could simply skip the JSI installation if the runtime is null, but the app may run in an unexpected state. in my case, the screen is entirely white.
the No source URL loaded, have you initialized the instance? error is just a warning not to root cause to crash.
Hello Guys Did anyone found the exact solution for this? I have tried all the reanimated2 versions with all setup but didn't found the solution yet.
+1
Hi I was wondering if there was an update on this. I ran into this today (was wondering why I couldn't debug at all. was very cryptic). To debug on android w/ Hermes enabled, I have to disable react native reanimated. Glad to provide a fix if there's any guidance on what is broken. Thanks!
I am also facing the same issue while debugging, app freezes on the simulator