OS:
_Platform:_
Output of $ ./gradlew assembleRelease --stacktrace
[...]
Processing react-native sourcemaps for Sentry upload.
> Analyzing 2 sources
> Rewriting sources
> Adding source map references
Uploading sourcemaps for release com.myApp-1.0.3 distribution 103
> Uploading source maps for release com.myApp-1.0.3
Source Map Upload Report
Minified Scripts
~/index.android.bundle (sourcemap at index.android.bundle.map)
Source Maps
~/index.android.bundle.map
Processing react-native sourcemaps for Sentry upload.
> Analyzing 2 sources
> Rewriting sources
> Adding source map references
error: http error: Release with version already exists (400)
:app:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
* Where:
Script '/home/nuno/myApp/node_modules/react-native-sentry/sentry.gradle' line: 126
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssetsreleaseSentryUpload'.
> Process 'command 'node_modules/sentry-cli-binary/bin/sentry-cli'' finished with non-zero exit value 1
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:bundleReleaseJsAndAssetsreleaseSentryUpload'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:337)
at org.gradle.api.internal.TaskInternal$execute.call(Unknown Source)
at sentry_47rram8gpmp66cbag65xzok2e$_run_closure1$_closure4$_closure7$_closure9.doCall(/home/nuno/myApp/node_modules/react-native-sentry/sentry.gradle:126)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:590)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:571)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: org.gradle.process.internal.ExecException: Process 'command 'node_modules/sentry-cli-binary/bin/sentry-cli'' finished with non-zero exit value 1
at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:367)
at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:31)
at org.gradle.api.tasks.AbstractExecTask.exec(AbstractExecTask.java:54)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 75 more
BUILD FAILED
Config:
Sentry.config('https://...@mySentryServer/...').install()
I have following issue: Failing to build the apk.
Seems that no matter which versionCode/versionName I use in ./android/app/build.gradle, it always fails.
Is there a way to disable source maps or release tracking?
It's not crucial and seems that the only way I'm getting this app out there is by unlinnking react-native-sentry...
Some numbers:
project:read, project:write, project:releases, event:read, event:write, org:read buildToolsVersion "23.0.1"@Onumis But when you change versionCode/versionName
the version code in the output changes, right?
Uploading sourcemaps for release com.myApp-1.0.3 distribution 103
We take the versionCode/versionName from the manifest and use them in conjunction with the distribution we create a unique build/release on the server which is necessary to have unique sourcemap mappings on the server.
So if you have multiple builds with the same version/distribution you may have to delete files of the release see: https://docs.sentry.io/learn/cli/releases/#delete-files
@HazAT It does change yes - As you can see from the logs, it is attempting to upload twice:
Processing react-native sourcemaps for Sentry upload.
> Analyzing 2 sources
> Rewriting sources
> Adding source map references
Uploading sourcemaps for release com.myApp-1.0.3 distribution 103
> Uploading source maps for release com.myApp-1.0.3
Source Map Upload Report
Minified Scripts
~/index.android.bundle (sourcemap at index.android.bundle.map)
Source Maps
~/index.android.bundle.map
Processing react-native sourcemaps for Sentry upload.
> Analyzing 2 sources
> Rewriting sources
> Adding source map references
error: http error: Release with version already exists (400)
:app:bundleReleaseJsAndAssets FAILED
I've configured Android and iOS with the same sentry server/project - perhaps that's the problem?
(I hadn't changed the iOS version though, I am unable to compile that on my linux machine)
So using the same project on the server shouldn't matter.
The problem is that it tries to upload it twice, I am not sure why though.
Are you using any kind of flavours or something?
Not sure what a flavour is, but the output of react-native-config in a console.log is:
API_URL:"<redacted>"
APPLICATION_ID:"<redacted>"
BUILD_TYPE:"debug"
DEBUG:true
FLAVOR:""
VERSION_CODE:1
VERSION_NAME:"1.0.3"
@Onumis did you find a solution? i have same issue
@cinder92 I unlinked this for now (note that you still get reports on Sentry, just without the extra info about the device / stack / etc)
Quick update on this.
I found an issue where we upload assets twice when running gradle, I will fix this.
Are you using sentry.io or your own installation?
Our own host. Version 8.9.0.
@Onumis Ok, so we are having an issue triggering the upload twice.
But at some point in the past we fixed something on the server preventing this error from happing.
So if it's possible for you to upgrade the server the error should be gone or stay tuned until I fix it :)
Great to know it! I don't think we can upgrade our server anytime soon as it's used for so many projects hehe, but I'll put it on the todo list :)
@Onumis Hey, I've just released 0.25.0, the error should be gone now :)
As the title says, is there any tips for temporarily disabling SourceMap uploading because our CI server uploads it anytime we make new commit on our repo.
@ohtangza You can add conditions to the Xcode run script phase or to your gradle file.
I haven't tested this but it should work if you adjust it to your needs
app.gradle
if(!System.getenv('isCI')) {
apply from: "../../node_modules/react-native-sentry/sentry.gradle"
}
Xcode run script
if [ "${isCI}" != "true" ]; then
export SENTRY_PROPERTIES=sentry.properties
export NODE_BINARY=node
../node_modules/sentry-cli-binary/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh
fi
this is useful and should be documented
thanks @HazAT
should be
if [ "${SENTRY_UPLOAD}" == "true" ]
then
export SENTRY_PROPERTIES=sentry.properties
export NODE_BINARY=node
../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh
else
export NODE_BINARY=node
../node_modules/react-native/scripts/react-native-xcode.sh
fi
Thanks @HazAT. This worked for Android:
app/build.gradle
if(!System.getenv('SENTRY_SKIP_UPLOAD')) {
apply from: "../../node_modules/react-native-sentry/sentry.gradle"
}
$ SENTRY_SKIP_UPLOAD=true ./gradlew assembleRelease
(in addition to all the other installation steps)
FYI: I use this for making release builds for internal or beta testing which are not necessary to be monitored by Sentry
This not works now. Get the following error:
/../MainApplication.java:16: error: package io.sentry does not exist
import io.sentry.RNSentryPackage;
^
/../MainApplication.java:72: error: cannot find symbol
new RNSentryPackage(),
^
symbol: class RNSentryPackage
2 errors
Someone have a workaround?
I am struggling for 5 days with my build failure. Can anyone know solution for the below.
When I archiving the file it shows the error as
Continuing in background.
Failed to display Xcode notification
Showing All Errors Only
+ [[ ! -f /Users/name/Library/Developer/Xcode/DerivedData/Appp-cperpitadfajoqxnkn/Build/Intermediates.noindex/ArchiveIntermediates/App/BuildProductsPath/Release-iphoneos/Appp.app/main.jsbundle ]]
Continuing in background.
Failed to display Xcode notification
caused by: script error: osascript: no such component "JavaScript".
Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
This will produced after quitting my Xcode the upload notification of sentry will shown in my window. After that it showing Continuing in background and shows. Failed to display Xcode notification
@HazAT I have been struggling to find a clear documentation on how to disable source maps all together. Can you pls point me to the correct place in the docs that has instructions to disable/opt out of source maps ?
The error we're seeing is:
13:06:11 Processing react-native sourcemaps for Sentry upload.
13:06:11 > Analyzing 2 sources
13:06:12 > Rewriting sources
13:06:13 > Adding source map references
13:06:20 > Uploading source maps for release com.myorg.myapp.[email protected]+6.22.1
13:06:43 error: API request failed
13:06:43 caused by: sentry reported an error: bad gateway (http status: 502)
Most helpful comment
Thanks @HazAT. This worked for Android:
app/build.gradle(in addition to all the other installation steps)
FYI: I use this for making release builds for internal or beta testing which are not necessary to be monitored by Sentry