Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.72: Remote debugging broken on Android #38006

Closed
edstbbz opened this issue Jun 21, 2023 · 14 comments
Closed

0.72: Remote debugging broken on Android #38006

edstbbz opened this issue Jun 21, 2023 · 14 comments
Labels
Debugger Issues related to React Native DevTools or legacy JavaScript/Hermes debugging Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Platform: Android Android applications. Platform: iOS iOS applications.

Comments

@edstbbz
Copy link

edstbbz commented Jun 21, 2023

Description

When upgrading to 0.72, the application crashes when connected to the Chrome debugger (test on Android)

2023-06-22 00:19:01.199 22414-22948 libc com.myapp.releasestaging A Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 22948 (mqt_js), pid 22414 (.releasestaging)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A Cmdline: com.myapp.releasestaging
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A pid: 22414, tid: 22948, name: mqt_js >>> com.myapp.releasestaging <<<
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #00 pc 000000000003b7f4 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreact_render_runtimescheduler.so (facebook::react::RuntimeSchedulerBinding::createAndInstallIfNeeded(facebook::jsi::Runtime&, std::__ndk1::shared_ptrfacebook::react::RuntimeScheduler const&)+68) (BuildId: 154f261ff589aa1e)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #1 pc 00000000002055e1 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #2 pc 0000000000205591 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #3 pc 0000000000205531 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #4 pc 00000000002054e1 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #5 pc 0000000000204300 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #6 pc 000000000028b3a9 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #7 pc 000000000028ad2c /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (std::__ndk1::function<void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) const+44) (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #8 pc 000000000028ac68 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #9 pc 000000000028ac11 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #10 pc 000000000028abb1 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #11 pc 000000000028ab61 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #12 pc 0000000000289ab0 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #13 pc 00000000002b56b9 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #14 pc 00000000002b5629 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (std::__ndk1::function<void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*) const+57) (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.750 22956-22956 DEBUG pid-22956 A #15 pc 00000000002b55e6 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #16 pc 00000000002b556c /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #17 pc 00000000002b551c /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #18 pc 00000000002b54ec /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #19 pc 00000000002b43b8 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #20 pc 00000000003e56d1 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libhermes_executor.so (BuildId: 53166c965b19a311)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #21 pc 00000000003e5694 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libhermes_executor.so (std::__ndk1::function<void ()>::operator()() const+20) (BuildId: 53166c965b19a311)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #22 pc 00000000002153c4 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #23 pc 000000000021533c /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #24 pc 00000000002152ec /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #25 pc 00000000002152bc /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #26 pc 0000000000214248 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libreactnativejni.so (BuildId: eedf0b28937d60c0)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #27 pc 0000000000016979 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libfbjni.so (facebook::jni::detail::MethodWrapper<void (facebook::jni::JNativeRunnable::)(), &(facebook::jni::JNativeRunnable::run()), facebook::jni::JNativeRunnable, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject>)+25) (BuildId: 24c51b71e72aa958d98c6f3c2304d6447e26c99e)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #28 pc 00000000000168f4 /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/lib/x86_64/libfbjni.so (facebook::jni::detail::FunctionWrapper<void ()(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject>), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*, void ()(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject>))+52) (BuildId: 24c51b71e72aa958d98c6f3c2304d6447e26c99e)
2023-06-22 00:19:01.751 22956-22956 DEBUG pid-22956 A #37 pc 00000000003ea1f2 [anon:dalvik-classes.dex extracted in memory from /data/app/~~4hmgMGlidXP0t4CIdUV4PA==/com.myapp.releasestaging-ZdypyK0mTp6SdihqT5qtnA==/base.apk] (com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run+74)

React Native Version

0.72.0

Output of npx react-native info

System:
OS: macOS 12.6.1
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 38.58 MB / 16.00 GB
Shell:
version: 5.8.1
path: /bin/zsh
Binaries:
Node:
version: 16.13.0
path: /usr/local/bin/node
Yarn:
version: 3.2.1
path: /usr/local/bin/yarn
npm:
version: 8.1.0
path: /usr/local/bin/npm
Watchman:
version: 2022.10.24.00
path: /usr/local/bin/watchman
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms:
- DriverKit 21.4
- iOS 16.0
- macOS 12.3
- tvOS 16.0
- watchOS 9.0
Android SDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9514443
Xcode:
version: 14.0.1/14A400
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.11
path: /usr/bin/javac
Ruby:
version: 2.6.5
path: /Users/user/.rvm/rubies/ruby-2.6.5/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.0
wanted: 0.72.0
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: false
newArchEnabled: false

Steps to reproduce

  1. react-native-run-android
  2. connect to Chrome debugger

Snack, code example, screenshot, or link to a repository

@github-actions
Copy link

⚠️ Add or Reformat Version Info
ℹ️ We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2

@lunaleaps lunaleaps added Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. 0.72 and removed Needs: Version Info Needs: Author Feedback labels Jun 21, 2023
@lunaleaps
Copy link
Contributor

Was able to reproduce this with a new app. See stacktrace: https://gist.github.com/lunaleaps/b6dafc94fbe22017e2737b15831ec0ad

@lunaleaps
Copy link
Contributor

As well, with iOS I get this error:

info Opening flipper://null/Hermesdebuggerrn?device=React%20Native...
error Browser exited with error:, invalid url, missing http/https protocol
info Opening flipper://null/Hermesdebuggerrn?device=React%20Native...
error Browser exited with error:, invalid url, missing http/https protocol

@cipolleschi
Copy link
Contributor

cc. @huntie as you are working on this part

@kelset kelset added Platform: iOS iOS applications. Platform: Android Android applications. Debugger Issues related to React Native DevTools or legacy JavaScript/Hermes debugging labels Jun 22, 2023
@blakef
Copy link
Contributor

blakef commented Jun 22, 2023

I think this is unrelated, that looks like you don't have the flipper client installed (which should register to handle the flipper url scheme.

As well, with iOS I get this error:

info Opening flipper://null/Hermesdebuggerrn?device=React%20Native...
error Browser exited with error:, invalid url, missing http/https protocol
info Opening flipper://null/Hermesdebuggerrn?device=React%20Native...
error Browser exited with error:, invalid url, missing http/https protocol

@huntie
Copy link
Member

huntie commented Jun 22, 2023

Hi @edstbbz! Sorry you're encountering this issue. Can you share a little more info on which debugging method you're attempting to launch here? ⬇️

  1. connect to Chrome debugger

As @lunaleaps and @blakef have noted, the current "Open Debugger" flow in the Dev Menu requires a local installation of the Flipper desktop app, and we unfortunately have an unclear error message when this URL cannot be handled 😔.

Likely workarounds:

@kudnayce
Copy link

debugging on android does not work the same error!

@edstbbz
Copy link
Author

edstbbz commented Jun 22, 2023

Hi @edstbbz! Sorry you're encountering this issue. Can you share a little more info on which debugging method you're attempting to launch here? ⬇️

  1. connect to Chrome debugger

As @lunaleaps and @blakef have noted, the current "Open Debugger" flow in the Dev Menu requires a local installation of the Flipper desktop app, and we unfortunately have an unclear error message when this URL cannot be handled 😔.

Likely workarounds:

Hello, @huntie ! The problem occurs when connecting to http://localhost:8081/debugger-ui or https://github.com/jhen0409/react-native-debugger , when I connect to it, app crashes. Launch via the developer menu in the modal window

@edstbbz
Copy link
Author

edstbbz commented Jun 22, 2023

The connection to the flipper worked, but the logs in hermes were not shown, perhaps because there is an old client, since we use Chrome for debugging

@AshlandWest
Copy link

AshlandWest commented Jun 27, 2023

I am also experiencing this issue, on a clean install of React Native 0.72.0.

My steps to reproduce:

  • npx react-native init <myProjectsName>
  • yarn start
  • a

Errors and Symptoms

The app loaded the example page, then I shook the device and started the debugger. The app crashed immediately and since then has crashed on launch.
In my zsh terminal, the last printed line is: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.<myAppsName>/.MainActivity }
In Logcat on Android Studio, it fails on the error: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 17160 (mqt_js), pid 17088 (com.<myAppsName>)

From my research, it looks like the phone's OS may be killing the application due to the application attempting to access something in memory it shouldn't be.

I get two errors inside the debugger:

  • DevTools failed to load SourceMap: Could not parse content for file:///Applications/React Native Debugger.app/Contents/Resources/app.asar/node_modules/react-devtools-core/dist/standalone.js.map: Unexpected end of JSON input

  • DevTools failed to load SourceMap: Could not parse content for file:///importFile.worker.worker.js.map: Unexpected end of JSON input

Regarding your suggestions

  • Install Flipper
    • Flipper is already installed
    • I ran brew upgrade to check if there was a version issue somewhere. The problem stayed the same.
  • Use Hermes via manual Chrome DevTools connection flow.
    • These steps didn't work for me. I am running Metro on port 8081 and when adding that to the discovery settings, it doesn't see Hermes React Native.

System info

Phone

  • Samsung Galaxy S22 Ultra
  • Android Version: 13
  • Security Patch Level: June 1, 2023

Computer:

  • MacBook Pro, 2023
  • Chip: Apple M2 Max
  • macOS: 13.2.1

React Native Info

System:
OS: macOS 13.2.1
CPU: (12) arm64 Apple M2 Max
Memory: 2.52 GB / 32.00 GB
Shell:
version: 5.8.1
path: /bin/zsh
Binaries:
Node:
version: 18.14.0
path: ~/.nvm/versions/node/v18.14.0/bin/node
Yarn:
version: 1.22.19
path: ~/.yarn/bin/yarn
npm:
version: 9.3.1
path: ~/.nvm/versions/node/v18.14.0/bin/npm
Watchman:
version: 2023.06.26.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.11.3
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 22.4
- iOS 16.4
- macOS 13.3
- tvOS 16.4
- watchOS 9.4
Android SDK:
API Levels:
- "29"
- "30"
- "31"
- "32"
- "33"
Build Tools:
- 29.0.2
- 30.0.2
- 30.0.3
- 31.0.0
- 32.0.0
- 32.1.0
- 33.0.0
System Images:
- android-30 | ARM 64 v8a
- android-30 | Intel x86 Atom_64
- android-30 | Google APIs ARM 64 v8a
- android-30 | Google APIs Intel x86 Atom
- android-30 | Google Play ARM 64 v8a
- android-31 | Google APIs ARM 64 v8a
- android-32 | Google APIs ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.9971841
Xcode:
version: 14.3.1/14E300c
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.19
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.0
wanted: 0.72.0
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

@pipo151086
Copy link

hi....

same here....

Chrome Dev Tools and Flipper

BOTH DOESNT WORK....

Hermes debugger does not connect, console is allways empty and breakpoints doest work either>

Flipper V 190
RN 0.72

@danisOktaxi
Copy link

Hi, same error
with RN 0.72.0
Flipper: 0.182.0

Error log crash on Flipper desktop app:

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 10277 (mqt_js), pid 10191 (AppName.debug)
Unknown

@lunaleaps
Copy link
Contributor

lunaleaps commented Jun 28, 2023

Hey folks, thanks for the continued reports.

We are working on a fix for the remote debugging (when you use the dev menu -> debug option) for 0.72.

We've also found an issue with direct debugging on Android (when you debug like this and are actively investigating. Direct debugging is only available for Hermes (which should be enabled by default for 0.72).

Direct debugging on iOS for 0.72 is functional, it seems to be an Android-only issue

@lunaleaps lunaleaps changed the title 0.72: The application crashes if you connect to Chrome debugger 0.72: Remote debugging broken on Android Jul 5, 2023
@lunaleaps
Copy link
Contributor

lunaleaps commented Jul 5, 2023

Issue is fixed for Android, remote debugging: 0fe5ffd

Pick request for 72: reactwg/react-native-releases#76 (comment)

I've opened a new issue just for direct debugging: #38204

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Debugger Issues related to React Native DevTools or legacy JavaScript/Hermes debugging Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Platform: Android Android applications. Platform: iOS iOS applications.
Projects
None yet
Development

No branches or pull requests

10 participants