Sentry-react-native: Error bundling for Android using custom buildType at task :app:bundleAlphaJsAndAssets_SentryUpload_20

Created on 3 Oct 2020  路  3Comments  路  Source: getsentry/sentry-react-native

OS:

  • [ ] Windows
  • [x] MacOS
  • [ ] Linux

Platform:

  • [ ] iOS
  • [x] Android

SDK:

  • [x] @sentry/react-native (>= 1.0.0)
  • [ ] react-native-sentry (<= 0.43.2)

SDK version: 1.8.2

react-native version: 0.63.2

Are you using Expo?

  • [ ] Yes
  • [x] No

Are you using sentry.io or on-premise?

  • [x] sentry.io (SaaS)
  • [ ] on-premise

I have following issue:

When trying to bundle a custom buildType on android I get:

> Task :app:bundleAlphaJsAndAssets_SentryUpload_20 FAILED
Processing react-native sourcemaps for Sentry upload.
error: No such file or directory (os error 2)

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleAlphaJsAndAssets_SentryUpload_20'.
> Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1

I have tried adding the following:

project.ext.sentryCli = [
    logLevel: "debug",
    flavorAware: true
]

in app/build.gradle but now I get:

> Task :app:bundleAlphaJsAndAssets_SentryUpload_20 FAILED

FAILURE: Build failed with an exception.

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

Steps to reproduce:

  • Add a custom buildType in the buildTypes section of:
alpha {
        initWith release
        matchingFallbacks = ["release", "debug"]
        applicationIdSuffix ".alpha"
}
  • Bundle the app
> cd android
> ./gradlew clean && ./gradlew assembleAlpha

Important note:
Doing the same for Release is working (./gradlew assembleRelease).

Android Needs Triage

Most helpful comment

Hi @MathieuUrstein,

I don't think this is a Sentry issue, I had a similar issue because of this line. Basically in the react-native gradle task, if your variant doesn't include release in the name, it won't output the sourcemaps.

3 solutions:

  • rename your build type to include "release" in the name
  • add a patch to react-native to replace this line and include alpha
  • I've also submitted a PR to RN, hopefully will get some feedback

All 3 comments

I found out that disabling Hermes would solve the issue.

Hi @MathieuUrstein,

I don't think this is a Sentry issue, I had a similar issue because of this line. Basically in the react-native gradle task, if your variant doesn't include release in the name, it won't output the sourcemaps.

3 solutions:

  • rename your build type to include "release" in the name
  • add a patch to react-native to replace this line and include alpha
  • I've also submitted a PR to RN, hopefully will get some feedback

Thanks for clarifying this up. It's correct. I close the issue.

Was this page helpful?
0 / 5 - 0 ratings