Skip to content

[Android] gradle release upload fails #404

@danielkcz

Description

@danielkcz

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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions