I am having expo react native application which has ios and android folders prebuilt in the source code. I having some configuration done in the native projects and hence it's available in the source code.
I integrated Sentry as per the documentation, and it records any crashing events in Sentry without any issue. But however, when I create a release build locally or through EAS build, though the crash events are getting recorded, the stack trace is obfuscated and I see the source maps are not uploaded. In Sentry it says
No Uploaded Artifacts The release this event belongs to doesn't have any uploaded artifacts. Upload your build artifacts to Sentry using the release:
No Debug ID Tooling Used This event doesn't contain any Debug IDs. Read the Sentry Source Maps Documentation to learn how to inject Debug IDs into your build artifacts and how to upload them to Sentry.
But as the docs suggested I have added the SENTRY_AUTH_TOKEN
to EAS environment variables.
Unfortunately, when I go to Sentry settings and check the access tokens, i see the access token has been never accessed which is bit troubling.
This is how I have setup sentry
In the RootLayout
file I added
Sentry.init({
dsn: 'dsn',
// uncomment the line below to enable Spotlight ()
// spotlight: __DEV__,
});
Then wrapped it
export const RootLayout = Sentry.wrap(Layout);
In app.json
I added
"plugins": [
[
"@sentry/react-native/expo",
{
"url": "/",
"project": "<<project-name>>",
"anization": "<<company-name>>"
}
]
]
However there are no artifacts uploaded in sentry. Any assistance would be greatly appreciated.
I am having expo react native application which has ios and android folders prebuilt in the source code. I having some configuration done in the native projects and hence it's available in the source code.
I integrated Sentry as per the documentation, and it records any crashing events in Sentry without any issue. But however, when I create a release build locally or through EAS build, though the crash events are getting recorded, the stack trace is obfuscated and I see the source maps are not uploaded. In Sentry it says
No Uploaded Artifacts The release this event belongs to doesn't have any uploaded artifacts. Upload your build artifacts to Sentry using the release:
No Debug ID Tooling Used This event doesn't contain any Debug IDs. Read the Sentry Source Maps Documentation to learn how to inject Debug IDs into your build artifacts and how to upload them to Sentry.
But as the docs suggested I have added the SENTRY_AUTH_TOKEN
to EAS environment variables.
Unfortunately, when I go to Sentry settings and check the access tokens, i see the access token has been never accessed which is bit troubling.
This is how I have setup sentry
In the RootLayout
file I added
Sentry.init({
dsn: 'dsn',
// uncomment the line below to enable Spotlight (https://spotlightjs)
// spotlight: __DEV__,
});
Then wrapped it
export const RootLayout = Sentry.wrap(Layout);
In app.json
I added
"plugins": [
[
"@sentry/react-native/expo",
{
"url": "https://sentry.io/",
"project": "<<project-name>>",
"anization": "<<company-name>>"
}
]
]
However there are no artifacts uploaded in sentry. Any assistance would be greatly appreciated.
Share Improve this question asked Mar 7 at 6:19 SVGSVG 9247 silver badges30 bronze badges 1 |1 Answer
Reset to default 0Based on the described behaviour of missing Debug IDs and having some native code changes, I believe the issue is in the following:
- Ensure that your project is using the Sentry Metro Plugin in
metro.config.js
, this automatically enables Debug IDs:
// const { getDefaultConfig } = require("expo/metro-config");
const { getSentryExpoConfig } = require("@sentry/react-native/metro");
// const config = getDefaultConfig(__dirname);
const config = getSentryExpoConfig(__dirname);
module.exports = config;
More information at https://docs.sentry.io/platforms/react-native/manual-setup/expo/#add-sentry-metro-plugin
- Ensure the prebuilt native code is up to date. The Sentry Expo Plugin (
@sentry/react-native/expo
) adds the automatic upload scripts to the Xcode Build Phases and to thebuild.gradle
. Below you can see examples of the updated code.
The Xcode Build Phase Bundle React Native code and images
last line should look like this (executing the sentry-xcode.sh
script):
/bin/sh `"$NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/react-native/package.json')) + '/scripts/sentry-xcode.sh'"` `"$NODE_BINARY" --print "require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'"`
The app/build.gradle
should apply the sentry.gradle
:
apply from: new File(["node", "--print", "require('path').dirname(require.resolve('@sentry/react-native/package.json'))"].execute().text.trim(), "sentry.gradle")
More information at https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#configure-automatic-source-maps-upload and https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#enable-gradle-integration
local
flag or in the cloud? As theSENTRY_AUTH_TOKEN
is probably stored as secret it's not available locally if you didn't declare it in your.env
file again. – Mo W. Commented Mar 7 at 18:05