Source Maps

To get unminified stack traces for JavaScript code, source maps must be generated and uploaded. The React Native SDK handles source maps automatically for iOS with Xcode and Android with Gradle, if you do not use custom values.

Choose one of the following guides depending on your setup, or try the automatic upload to get started.

The easiest way to configure automatic source maps upload is to use the Sentry Wizard:

Copied
npx @sentry/wizard@latest -i reactNative

The wizard will guide you through the following steps:

  • Logging into Sentry and selecting a project
  • Installing the necessary Sentry packages
  • Configuring RN build tools to generate and upload source maps

It supports JavaScript Core (including RAM Bundle) and Hermes. If you want to configure automatic source maps upload manually, follow the steps on the Manual Configuration page.

If you want to disable the automatic upload of source maps, you can set the SENTRY_DISABLE_AUTO_UPLOAD environment variable:

Copied
export SENTRY_DISABLE_AUTO_UPLOAD=true

Add the shouldSentryAutoUpload function in android/app/build.gradle:

Copied
apply from: "../../../sentry.gradle"

sentry {
    autoUploadProguardMapping = shouldSentryAutoUpload()
    uploadNativeSymbols = shouldSentryAutoUpload()
}
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").