Source Maps for Other Platforms
Note
This SDK has been superseded by the new React Native SDK. Sentry preserves this documentation for customers using the old client. We recommend using the updated React Native SDK for new projects.
Currently automatic source map handling is only implemented for iOS with Xcode and Android with gradle. If you manually invoke the react-native packager you can however get source maps anyways by passing –sourcemap-output to it.
If you do get source maps, you can upload them with sentry-cli
. Before v1.59.0, please ensure passing --rewrite
to the upload-sourcemaps
command which will fix up the source maps before the upload (inlines sources etc.). As of 1.59.0, this is done automatically.
Example:
react-native bundle \
--dev false \
--platform android \
--entry-file index.android.js \
--bundle-output android.main.bundle \
--sourcemap-output android.main.bundle.map
To then upload you should use this:
node_modules/@sentry/cli/bin/sentry-cli releases \
files RELEASE_NAME \
upload-sourcemaps \
--dist DISTRIBUTION_NAME \
--strip-prefix /path/to/project/root \
/path/to/your/files
The values for RELEASE_NAME
and DISTRIBUTION_NAME
are as follows:
RELEASE_NAME
:- the bundle ID or package name (reverse dns notation of your app) followed by a dash and the human readable version name that
is set for your release. So for instance
com.example.myapp-1.0
.
If you set the release name within your app, the RELEASE_NAME
should be the same value. e.g.
Sentry.setRelease(RELEASE_NAME);
DISTRIBUTION_NAME
:- This is the version code or build id depending on your platform. So for instance just set this to whatever is set in your Info.plist or what your gradle setup generates (eg:
52
).