OS:
Platform:
SDK:
@sentry/react-native (>= 1.0.0)react-native-sentry (<= 0.43.2)SDK version: 1.4.1
react-native version: 0.61.5
Are you using Expo?
Are you using sentry.io or on-premise?
If you are using sentry.io, please post a link to your issue so we can take a look:
This is an issue regarding source map uploading
Configuration:
using the default iOS source map uploading steps in iOS (xcode) & Android (gradle)
I have following issue:
I have setup react-native sentry using the default setup as outlined in the docs. Using the upload source maps steps as added by the sentry wizard.
for both iOS and Android however the release names generated in the default setup are now allowed by sentry.
The error message (and generated release name) is the same on both platforms:
error: API request failed
caused by: sentry reported an error: request failure (http status: 400)
Object({"version": Array([String("Release with name nl.pzc.news@build feature/POPKUBUS-2032 (1591336311)+16656 is not allowed")])})
In both cases the builds are created on Bitrise and the builds thus fail on this step.
I would like to keep using the automated source map uploads but perhaps i can add some configuration to make these names fit whatever requirements Sentry apparently has for these names. I cannot find these requirements in the docs btw.
Steps to reproduce:
Actual result:
build fails with the above error
Expected result:
a working build and related source maps for this build in Sentry
Ideally i would like to configure this part of the sentry.gradle script (and the corresponding iOS one) so it uses a release name of my choosing:
def releaseName = "${variant.getApplicationId()}@${variant.getVersionName()}+${versionCode}"
I'm guessing what is generated now is not accepted due to the spaces or the length?
Yes, i would also like a way to customize the releaseName via sentry.properties or via passing an argument in the build script for sentry
@StarryFire yes! indeed. or maybe just an exported RELEASE_NAME variable like it currently passes variables to the cli in the xcode build script.
I don't have api errors, It always 200 BUT......
At the last month I sent artifacts from xcode via
export SENTRY_PROPERTIES=sentry.properties
../node_modules/@sentry/cli/bin/sentry-cli upload-dsym
and then artifacts puts in Release 2.2.0 (the same semver, different dists in one group)...
Today its broken... Artifacts puts outside of 'environment' and has name 'com.app@@2.2.0+333' it's so ridiculous. Nothing changes by me, but it's just broken.... Every artifact for iOS puts as a single release...........

selfhosted sentry
Just so this isn't abandoned. The automatic uploading of sourcemaps seems so wonderful till you realize it creates its own release and they never get associated properly because of it.
I had to add a plugin to basically sed the build.gradle file on Android so Sentry could even read proper version name/code since it wasn't reading whatever environment fastlane uses to ad-hoc version on the fly.
Sentry then built a release version for me like combing strings in attempt to build one for me. Why can't it just use an environment variable or even properties file of a release I already have? It seems weird that one step of my build process for uploading sourcemaps wants to make all these assumptions.
It gets hardcoded here - https://github.com/getsentry/sentry-react-native/blob/master/sentry.gradle#L66 and https://github.com/getsentry/sentry-react-native/blob/master/sentry.gradle#L168 - Am I doing something wrong?
How do others make this work?

I may have releases automated and working well, but this one step ignores all those environment variables and then just makes a version on some old hard-coded version name/code variables.
I would prefer just to tell Sentry to stop uploading these period and do it myself with sentry-cli, but I can't figure that out without some hacky gradle changes (see https://github.com/getsentry/sentry-react-native/issues/1042)
@iBotPeaches Did you found a solution for this? I am facing the same issue.
@iBotPeaches Did you found a solution for this? I am facing the same issue.
Nothing pretty. I hack out the job that runs
gradle.projectsEvaluated {
def tasksToSkip = project.tasks.matching {
it.name.contains("SentryUpload")
}
tasksToSkip.all { enabled = false }
}
and build/upload my own sourcemaps with sentry-cli.
Most helpful comment
Yes, i would also like a way to customize the releaseName via sentry.properties or via passing an argument in the build script for sentry