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.

[0.60.3] --sourcemap-output | enableHermes: false | gradle file | wrong output path

See original GitHub issue

React Native version: 0.60.3

Steps To Reproduce

  1. react-native init test
  2. cd test/android
  3. Make sure you have these default settings:
project.ext.react = [
    entryFile: "index.js",
    enableHermes: false,  // clean and rebuild if changing
]
  1. ./gradlew assembleRelease --stacktrace
  2. Check content of android/app/build/generated/assets/react/release/index.android.bundle
  3. Check last line, content is: //# sourceMappingURL=index.android.bundle.packager.map

Expected:

//# sourceMappingURL=index.android.bundle.map


So the problem with this is at least twofold. First I think if hermes is not enabled it shouldn’t mess with the --sourcemap-output parameter at all. Reason why this came up is this: https://github.com/getsentry/sentry-react-native/issues/612#issuecomment-511899296 Hermes apparently needs an intermediate path and messes with this arg which breaks our setup.

At Sentry we try to pick up on this arg to determine the location but, this is not the real location since you move the file there later, see: https://github.com/facebook/react-native/blob/0190c9c97b598b782d677e748d211437b4b85dd1/react.gradle#L172-L175 (Same for bundle)

And also, if the reference on the bottom of the file is not correct we cannot load it correctly.

I am not sure how to solve this since just copying instead of moving really doesn’t. If hermes is enabled it seems to work correctly, I am not sure why the source maps and bundle need to go in the intermediate folder tho.

If you know a way how to fix it, I would provide a PR for it.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
motiz88commented, Jul 19, 2019

Thanks again for surfacing this and sending a PR! Feel free to tag me on any further issues/requests related to source maps or crash logging.

2reactions
HazATcommented, Jul 19, 2019

@motiz88 confirmed, it works! Thx!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solving common problems - Gradle User Manual
Currently Gradle only tracks on a per-task basis that no file encoding has been specified, but it does not track the system encoding...
Read more >
Getting "java.lang.UnsatisfiedLinkError: couldn't find DSO to load
I let Hermes disabled in my app build.gradle file: project.ext.react = [ entryFile: "index.js", enableHermes: false, ...
Read more >
How to: enable Hermes JavaScript engine in your React ...
The first thing to do is to set the enableHermes option to true in the React Native project configuration. This is typically done...
Read more >
Configure your build - Android Developers
The Gradle settings file; The top-level build file; The module-level build file; Gradle properties files; Remap the NDK to a shorter path (Windows...
Read more >
The Google Services Gradle Plugin
You can see the result of this step by running . ... The google-services.json file is generally placed in the app/ directory (at...
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