Sentry-react-native: app:bundleReleaseJsAndAssets FAILED when building Android

Created on 26 Apr 2018  路  3Comments  路  Source: getsentry/sentry-react-native

_Platform:_

  • [ ] iOS
  • [x] Android

I'm trying to build our RN project on Microsoft AppCenter and facing this issue after integrating Sentry for Android.

When this command executes - [command]/Users/vsts/agent/2.131.0/work/1/s/android/gradlew -DMOBILECENTER_KEYSTORE_PASSWORD=******** -DMOBILECENTER_KEY_ALIAS=******** -DMOBILECENTER_KEY_PASSWORD=******** -DMOBILECENTER_BUILD_VERSION=1524662574 -DAPPCENTER_KEYSTORE_PASSWORD=******** -DAPPCENTER_KEY_ALIAS=******** -DAPPCENTER_KEY_PASSWORD=******** -DAPPCENTER_BUILD_VERSION=1524662574 -p android clean :app:assembleRelease

I am getting this error..

...
...
bundle: Copying 265 asset files
bundle: Done copying assets
:app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* Where:
Script '/Users/vsts/agent/2.131.0/work/1/s/node_modules/react-native-sentry/sentry.gradle' line: 176

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssetsreleaseSentryUpload'.
> java.lang.NullPointerException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 7 mins 28.399 secs
Error: /Users/vsts/agent/2.131.0/work/1/s/android/gradlew failed with return code: 1
    at ChildProcess.<anonymous> (/Users/vsts/agent/2.131.0/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/1.128.0/node_modules/vsts-task-lib/toolrunner.js:569:30)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:497:12)
##[error]Error: /Users/vsts/agent/2.131.0/work/1/s/android/gradlew failed with return code: 1

Would love some help here :)

Most helpful comment

So I was able to fix this issue by disabling the flavorAware option. When using this option, the build task was looking for a sentry.${flavor}.properties (where flavor is release or debug) file which was not available in the project. I just had sentry.properties.

All 3 comments

So I was able to fix this issue by disabling the flavorAware option. When using this option, the build task was looking for a sentry.${flavor}.properties (where flavor is release or debug) file which was not available in the project. I just had sentry.properties.

Thanks for clearing this up, will close this issue. 馃憤

I found this thread as I got the same error, however we did not use Sentry in our project, and the issue we had is appcenter-pre-build.sh: line 32: =: command not found I fixed it, and the error was resolved!

so, in our case, it was an issue related to an error in the appcenter-pre-build.sh

Was this page helpful?
0 / 5 - 0 ratings