react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

Crash on Android when enabling debug mode

Open radko93 opened this issue 5 years ago • 11 comments

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

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

radko93 avatar May 04 '21 11:05 radko93

Issue validator

The issue is invalid!

  • Section required but not found: actual behavior & steps to reproduce(for label 🐞 bug)

github-actions[bot] avatar May 04 '21 11:05 github-actions[bot]

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

jgonet avatar May 04 '21 12:05 jgonet

@jakub-gonet - what if you're using jsc instead of hermes and not using any of the reanimated 2 apis?

brentvatne avatar May 18 '21 20:05 brentvatne

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 avatar May 20 '21 09:05 slorber

@slorber - it is possible to use hermes and flipper but it's not yet compatible with expo-updates

brentvatne avatar May 20 '21 17:05 brentvatne

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

jgonet avatar May 28 '21 10:05 jgonet

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.

Kudo avatar May 28 '21 17:05 Kudo

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.

dilipsuthar97 avatar Jun 27 '21 07:06 dilipsuthar97

+1

jehee-choi avatar Jul 01 '21 04:07 jehee-choi

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!

mikelikespie avatar Aug 19 '21 02:08 mikelikespie

I am also facing the same issue while debugging, app freezes on the simulator

surbhidavara99 avatar Jun 16 '23 10:06 surbhidavara99