margelo / react-native-release-profiler

A fast and simple library to passively profile JS/Hermes performance in production and release builds.
https://margelo.io
MIT License
188 stars 2 forks source link

fix: don't crash the process if android project doesn't exist #9

Closed kirillzyusko closed 1 week ago

kirillzyusko commented 1 week ago

Before

/Users/kirylziusko/IdeaProjects/margelo/react-native-release-profiler/lib/commonjs/cli.js:90
      throw new Error("Failed to retrieve the package name from the project's Android manifest file. Please provide the package name with the --appId flag.");
            ^

Error: Failed to retrieve the package name from the project's Android manifest file. Please provide the package name with the --appId flag.
    at downloadProfile (/Users/kirylziusko/IdeaProjects/margelo/react-native-release-profiler/lib/commonjs/cli.js:90:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.14.0

After

info File to be pulled: trace-2024-06-25T08_42_59.123Z.cpuprofile.txt
Getting source maps from Metro packager server
Downloading from http://localhost:8081/index.map?platform=android&dev=true&minify=false
Error: Cannot obtain source maps from Metro packager server
warn Cannot find source maps, running the transformer without it
info Instructions on how to get source maps: set `bundleInDebug: true` in your app/build.gradle file, inside the `project.ext.react` map.
success Successfully converted to Chrome tracing format and pulled the file to ./trace-2024-06-25T08_42_59.123Z.cpuprofile.txt-converted.json

Closes https://github.com/margelo/react-native-release-profiler/issues/2

hannojg commented 1 week ago

:shipit: