Why does React Native app crash when clicking on debug in Android emulator?

React Native app shows error when clicked on debug in Android emulator

Attempt to invoke interface method java.lang.String com.facebook.react.bridge.Cat alystInstance.getSourceURL('on a null object reference

below are error screenshots

Emulator screenshot:
1

Debugger screenshot:
2

When clicked on reload app crashes and lost connection to debugger.

Tried uninstalling and reinstalling apk in emulator and cd android ./gradlew clean.

Still same error.


I have faced same issue and it was due to the 'react-native-reanimated' package (It's mentioned in their documentation that remote debugging is no longer possible for react-native-reanimated : React Native Reanimated Known problems and limitations) and the solution is to use flipper to debug : Debugging React Native apps with Flipper