Hermes Profiler is broken in React Native 0.69.5 and 0.70.0

This issue has been tracked since 2022-09-15.

Description

When using the Hermes profiler with a fresh react native app, after enabling Hermes, the profiler file is always empty. Tested using React Native 0.69.5 and 0.70.0.

Tested with Samsung S21 Android 12 and a Macbook Pro M1.

Version

0.70.0

Output of npx react-native info

info Fetching system and libraries information...
System:
OS: macOS 12.6
CPU: (10) arm64 Apple M1 Pro
Memory: 2.42 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.13.1 - ~/.asdf/installs/nodejs/16.13.1/bin/node
Yarn: Not Found
npm: 8.1.2 - ~/.asdf/plugins/nodejs/shims/npm
Watchman: 2022.09.05.00 - /opt/homebrew/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: 2021.2 AI-212.5712.43.2112.8815526
Xcode: 14.0/14A309 - /usr/bin/xcodebuild
Languages:
Java: 11.0.13 - /Users/eliaslecomte/.asdf/shims/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.3 => 0.69.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. Create a new repo
  2. Enable hermes (enableHermes in android/app/build.gradle)
  3. Run android: npx react-native run-android
  4. Press d in packager
  5. Press Enable Sample Profiler (to start)
  6. Press d in packager
  7. Press Enable Sample Profiler (to stop)
  8. Get a toast

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

Error when downloading the sample:

info Downloading a Hermes Sampling Profiler from your Android device...
info No filename is provided, pulling latest file
warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
info File to be pulled: sampling-profiler-trace2304690698737821966.cpuprofile
error /var/folders/wn/53s2bq6n7_d3z6cpvd3zx7lr0000gp/T/sampling-profiler-trace2304690698737821966.cpuprofile is an empty file.
Error: /var/folders/wn/53s2bq6n7_d3z6cpvd3zx7lr0000gp/T/sampling-profiler-trace2304690698737821966.cpuprofile is an empty file

Also verified via Android Studio's Device File Explorer, the file exists but is empty.
image

cortinico wrote this answer on 2022-09-18

Thanks for reporting this. Closing as this issue was fixed in 0.70.1:

Please reopen if the issue persists.

More Details About Repo
Owner Name facebook
Repo Name react-native
Full Name facebook/react-native
Language JavaScript
Created Date 2015-01-09
Updated Date 2022-10-05
Star Count 105157
Watcher Count 3670
Fork Count 22478
Issue Count 2227

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date