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.

Uploaded index.android.bundle has a 0 B size in release artifacts and error stack traces are minified

See original GitHub issue

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native
  • react-native-sentry

SDK version: 1.3.1 react-native version: 0.61.5

Init Code:

Sentry.init({
  dsn: 'https://...@sentry.customdomain.com/...'
});

For some reason, the uploaded release artifact of index.android.bundle gets uploaded to our Sentry instance with a size of 0 B. When clicking to download it, its contents are:

{"detail": "Internal Error", "errorId": "..."}

This happens only with Android. In the same repo, we tried cutting a release with Xcode and both artifacts (index.android.bundle and index.android.bundle.map) get uploaded successfully.

Not sure if it’s the cause, but in error stack traces we don’t get anything meaningful like files and source code lines. Instead, everything is minified.

Passing the debug flag to see the Sentry upload requests, all seem OK and the server responds with 200 OK. There are no errors.

Related issue filed against sentry: https://github.com/getsentry/sentry/issues/17005

I opened this issue because I don’t believe this is a sentry but a sentry-react-native issue. iOS seems to work fine both in terms of uploaded artifacts as well as meaningful stack traces.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Swatinemcommented, Feb 24, 2020

The weird thing is the uploaded bundle is not 0 B for iOS. Is this normal?

yes. The 0B thing is specific to hermes bytecode, which is only relevant for android.

0reactions
alex-a-pereiracommented, Jul 13, 2021

Just solved my issue, ended up being a configuration issue on our end rather than an issue with sentry/hermes.

We use MS AppCenter to build our RN app for Android, and use the feature to automatically manage incrementing the build number. not 100% sure how it works, but it doesn’t modify the versionCode written in android/app/build.gradle. Our versionCode was hardcoded to 2 inside build.gradle, and sentry uses the value inside the file to determine what version the sourcemaps are uploaded for.

for example the app was being built with build_number == 154 so issues reported to sentry from the sentry-sdk had release = 1.3.0 (154). But sourcemaps were being uploaded for 1.3.0 (2), so sentry couldn’t find them which makes sense.

Here’s the code for the fix:

// android/app/build.gradle
// if building in appcenter, use the build id here, otherwise just use 1 because we're building locally
versionCode System.getenv('APPCENTER_BUILD_ID') ? Integer.parseInt(System.getenv('APPCENTER_BUILD_ID')) : 1
Read more comments on GitHub >

github_iconTop Results From Across the Web

Android failed to load JS bundle - react native - Stack Overflow
To bundle JS file into your apk while having your server running ( react-native start ) download bundle into assets directory of your...
Read more >
Release Notes | Firebase - Google
The Firebase Android SDKs for Cloud Messaging have been updated. ... Android (SDK version 24.1.0), and web (SDK version 9.9.2) can load local...
Read more >
Safari Technology Preview Release Notes - Apple Developer
Safari Technology Preview Release 147 is now available for download for macOS ... Fixed JS stack traces to report the correct column number...
Read more >
Gradle for Android - Unity - Manual
Gradle is a build system that automates a number of build processes and prevents many common build errors. Unity uses Gradle for all...
Read more >
JavaScript - Docs - Sentry Documentation
For Sentry to de-minify your stack traces you must provide both the minified files (e.g. ... you have two choices for naming your...
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