Uploading Symbol Files #
Uploading Source Maps #
In Xcode, find the “Bundle React Native code and images” step in the Build Phases tab. The contents should look something like the following:
export NODE_BINARY=node ../node_modules/react-native/scripts/react-native-xcode.sh
Change the contents to the following:
export NODE_BINARY=node export EXTRA_PACKAGER_ARGS="--sourcemap-output $CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/main.jsbundle.map" ../node_modules/react-native/scripts/react-native-xcode.sh
If you used the setup script mentioned on the Adding the Embrace SDK page, this change has already been made for you.
Add extra arguments to the bundle step in
project.ext.react = [ entryFile: "index.js", extraPackagerArgs: ["--sourcemap-output", "$buildDir/generated/sourcemaps/android-embrace.bundle.map"] ]
Note on variants By default, source maps are uploaded only for the release variant. If you’d like to upload source maps for other variants, make the following changes:
project.ext.react = [ ... bundleIn<customVariant>: true, devDisabledIn<customVariant>: true, extraPackagerArgs: ["--sourcemap-output", "$buildDir/generated/sourcemaps/android-embrace.bundle.map"] ]
This creates a bundle and sets the debuggable flag to false.
Symbolication with CodePush #
If you use App Center CodePush or any other service to deploy OTA (over the air) updates, you’ll need to upload those source maps to Embrace using the upload script that ships with the iOS SDK.
For CodePush, you’ll need to generate the bundle and source map to be uploaded.
appcenter codepush release-react -a MyApp --output-dir ./build --sourcemap-output ./map
Then, use the Embrace upload script to upload the source map.
ios/Pods/EmbraceIO/upload --app <your app ID> --token <your token> --rn-bundle ./build/CodePush/main.jsbundle --rn-map ./map
Uploading Native Symbol Files #
Proguard files will be uploaded automatically. If you don’t see symbolicated crashes while using Proguard, reach out to us on Slack and we’ll work with you directly.
Note We do not officially support Dexguard.
[[RNEmbrace sharedIntance] setJavasScriptBundleURL: pathToBundle];
Expo Apps #
If your app is built using Expo and you leverage OTA to distribute updates to your users, you must manually upload source maps using the script distributed with the SDK as described in the Symbolication with CodePush section.
Now that you know how to upload symbol files to make sure stack traces are translated on the Dashboard, let’s generate your first session.Create Your First Session