question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bundle file and sourcemap don't get to be uploaded on Sentry through gradle

See original GitHub issue

Environment

How do you use Sentry?

  • sentry.io

Which SDK and version?

Steps to Reproduce

I set up sentry for react-native following the instructions from the website. In short I have the following:

settings.gradle

include ':@sentry_react-native'
project(':@sentry_react-native').projectDir = new File(rootProject.projectDir, '../node_modules/@sentry/react-native/android')

build.gradle

project.ext.sentryCli = [
  logLevel: "debug"
]

...

if (project.env.get("SENTRY_ORG") != "") {
  apply from: "../../node_modules/@sentry/react-native/sentry.gradle"
}

...

implementation project(':@sentry_react-native')

android/sentry.properties

defaults.url=https://sentry.io/
defaults.org=
defaults.project=
auth.token=

I’m using fastlane on my computer to build and release new app updates. I use the following:

    bump_version(type: options[:type])
    version = android_get_version_name
    build = android_get_version_code

    gradle(task: "clean")

    # I tried the assemble task (that generates APK) but it does the same
    gradle(
      task: "bundle",
      build_type: "Release",
      print_command: false
    )

Out of it, I have the following files generated. I believe been triggered by sentry gradle

[07:19:18]: ▸ > Task :app:bundleReleaseJsAndAssets
[07:19:18]: ▸ warning: the transform cache was reset.
[07:19:18]: ▸ Welcome to React Native!
[07:19:18]: ▸ Learn once, write anywhere
[07:19:44]: ▸ info Writing bundle output to:, /path/app/build/generated/assets/react/release/index.android.bundle
[07:19:44]: ▸ info Writing sourcemap output to:, /path/index.map
[07:19:44]: ▸ info Done writing bundle output
[07:19:44]: ▸ info Done writing sourcemap output
[07:19:45]: ▸ info Copying 250 asset files
[07:19:46]: ▸ info Done copying assets
[07:19:46]: ▸ > Task :app:mergeReleaseShaders
[07:19:46]: ▸ > Task :app:compileReleaseShaders NO-SOURCE
[07:19:46]: ▸ > Task :app:generateReleaseAssets UP-TO-DATE

However, I don’t get any app:bundleProductionReleaseJsAndAssets_SentryUpload following this step. I workaround using the fastlane sentry plugin to create a release and upload bundle and sourcemaps, but I imagine it would work out of the box using the sentry gradle

Expected Result

Bundle file and sourcemap should be uploaded in the gradle step.

Actual Result

Bundle file and sourcemaps are not “automatically” uploaded.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jeremybarbetcommented, Apr 14, 2021

@kamilogorek @marandaneto Thanks for the wild ride through Sentry repositories, it was fun!

@leonskim That was it! Do you remember why I did add this option? 😄 Probably some copy/paste from StackOverflow to change JVM configurations

1reaction
jeremybarbetcommented, Apr 15, 2021

@marandaneto I went over this page a couple of times but didn’t pay attention to this, unfortunately. Maybe a warning hint kind-of-style would be more visible. Thanks all for the help 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sourcemaps are uploaded by gradle but are not matched ...
For extra context, I just tried to manually upload the sourcemap because even after verifying the bundle+sourcemap had been uploaded by gradle, ...
Read more >
Source Maps for React Native | Sentry Documentation
The React Native SDK handles source maps automatically for iOS with Xcode and Android with Gradle, if you do not use custom values....
Read more >
Sentry source maps with hermes in react-native | by Petr Lzicar
I was informed that need upload custom source maps. After some trying and failing, failing and failing created shell script which extract souce ......
Read more >
sentry/react-native/sentry.gradle - UNPKG
// was found for the asset folder we just bail. "--bundle", bundleOutput, // The path to a bundle that should be uploaded. "--sourcemap",...
Read more >
React Native - Sentry Documentation
For Android, we hook into Gradle for the source map build process. When you run react-native link , the Gradle files are automatically...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found