sentry-react-native: [Android] gradle release upload fails
OS:
- Windows
- MacOS
- Linux
Platform:
- iOS
- Android
Output of node -v && npm -v && npm ls --prod --depth=0
v9.11.1
5.6.0
# I am using Yarn and the NPM output is full of unrelated warnings, so dependencies from package.json
"apollo-cache-inmemory": "^1.1.11",
"apollo-client": "^2.2.7",
"apollo-link": "^1.2.1",
"apollo-link-context": "1.0.7",
"apollo-link-error": "^1.0.7",
"apollo-link-http": "^1.5.3",
"apollo-link-retry": "2.2.2",
"apollo-link-ws": "^1.0.8",
"apollo-utilities": "1.0.11",
"date-fns": "next",
"debug": "3.1.0",
"graphql": "0.12.3",
"graphql-tag": "2.8.0",
"graphql-tools": "^2.22.0",
"mobx": "^4.1.1",
"mobx-react": "^5.0.0",
"mobx-state-tree": "^2.0.3",
"random-js": "1.0.8",
"react": "^16.3.2",
"react-apollo": "^2.1.3",
"react-native": "~0.55.3",
"react-native-easy-grid": "0.1.16",
"react-native-firebase": "3.2.0",
"react-native-image-sequence": "gijoehosaphat/react-native-image-sequence",
"react-native-sentry": "^0.36.0",
"react-native-sound": "^0.10.9",
"react-native-svg": "6.0.1-rc.1",
"react-router-native": "^4.2.0",
"recompose": "0.26.0",
"redbox-react": "1.5.0",
"styled-components": "2.4.0",
"subscriptions-transport-ws": "0.9.7",
"ts-enum-util": "2.0.2",
"verror": "1.10.0"
Config:
Sentry.config(process.env.SENTRY_DSN, {
logLevel: SentryLog.Debug,
deactivateStacktraceMerging: Platform.OS === 'android',
}).install()
Release APK (gradlew assembleRelease
) is successfully built, but subsequent upload to sentry fails.
Actual result:
DONE Built successfully in 64.82s!
Assets location: D:\workspace\project\android\app\build\intermediates\res\merged\release
Bundle location: D:\workspace\project\android\app\build\intermediates\assets\release\index.android.bundle
Executing task ':app:bundleReleaseJsAndAssetsreleaseSentryUpload' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
Starting process 'command 'cmd''. Working directory: D:\workspace\project Command: cmd /c node_modules/@sentry/cli/bin/sentry-cli --log-level debug react-native gradle --bundle D:\workspace\project\android\app\build\intermediates\assets\release\index.android.bundle --sourcemap D:\workspace\project\android\app\build\intermediates\assets\release\index.android.bundle.map --release org.my.app-1.0 --dist 1
Successfully started process 'command 'cmd''
'node_modules' is not recognized as an internal or external command,
operable program or batch file.
:app:bundleReleaseJsAndAssets FAILED
Running that generated command was asking for --org
and then --project
which I added along with auth token and then it finished succesfully. I checked sentry.gradle which adds org/project only if flavorAware
is enabled which is strange, but after enabling it and running gradlew assembleRelease
again it ends up with a different, even more cryptic error.
Script 'D:\workspace\project\node_modules\react-native-sentry\sentry.gradle' line: 176
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssetsreleaseSentryUpload'.
> java.lang.NullPointerException (no error message)
* 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_wkf9t4girtt9iyd7pfjye2ee$_run_closure1$_closure4$_closure11.doCall(D:\workspace\project\node_modules\react-native-sentry\sentry.gradle:176)
Steps to reproduce:
That would probably require some repo to reproduce. Basically I run the react-native link react-native-sentry
to get wizard autoconfigure it.
What might be worth noting that I am using TypeScript and my entry file is src/index.ts
. This is then bundled with HaulJS which is using Webpack underneath, but result bundle works in the application, so it’s probably not that relevant.
Expected result: What more to say, running directly the CLI works, so that will my current workaround for now, but would be nice to have it automated.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 31 (7 by maintainers)
Commits related to this issue
- Add proper windows support with default config This fixes issue #404 — committed to BrendonSled/react-native-sentry by BrendonSled 6 years ago
- Add proper windows support with default config (#523) This fixes issue #404 — committed to getsentry/sentry-react-native by BrendonSled 5 years ago
- Updated appcompat version (again), switched to yarn Needed to update react-native-sentry version to fix a bug with building on Windows (https://github.com/getsentry/react-native-sentry/issues/404) — committed to appdevdesigns/adroit-mobile by grahammcculloch 5 years ago
check if defaults.project in sentry.properties file is exactly the same with name on sentry.io, may be you renamed it after sentry has been installed for me it fixed the issue
@HazAT Could you please refocus on the issue at hand? You haven’t even responded to anything above.
Also @anandwahed shame on you for hijacking. Make your own issue if you see there is obvious difference 😕
I had the same issue. I managed a local workaround by setting a static path to my local sentry cli.executable in ‘sentry.properties’ (e.g. where it was ‘cli.executable=node_modules/@sentry/cli/bin/sentry-cli’ I changed to ‘cli.executable=C:/Projetos/app/node_modules/@sentry/cli/bin/sentry-cli’).
Come on guys, everything is fine 😃 @FredyC Can you enable verbose logging in gradle? https://docs.sentry.io/clients/react-native/manual-setup/#android
I’m still having this issue on Mac OS X when running
react-native run-android
. Seems related to https://github.com/getsentry/react-native-sentry/issues/539@fungilation @FredyC On windows you must change and put direct path to sentry executable. Open
./android/sentry.peropertise
:Delete below line :
cli.executable=node_modules\\@sentry\\cli\\bin\\sentry-cli
And instead of that, put this line:
cli.executable=[YOUR WINDOWS DRIVE:\\YOUR PROJECT PATH]\\node_modules\\@sentry\\cli\\bin\\sentry-cli
Enjoy with my changes :
cli.executable=D:\\Workspace\\Etode\\node_modules\\@sentry\\cli\\bin\\sentry-cli
Closing this for now since I merged the PR for windows support. https://github.com/getsentry/react-native-sentry/pull/523 Will be included in next release.