Passing --sourcemap-output to extraPackagerArgs fails to build.
See original GitHub issueš Bug Report
I want to generate sourcemaps when running ./gradlew assembleRelease
.
I looked into react.gradle
and saw that it accepts extraPackagerArgs
and passes that to the bundle command.
So I tried passing the --sourcemap-output
option in my build.gradle
like so:
project.ext.react = [
extraPackagerArgs: [ "--sourcemap-output", "$buildDir/intermediates/assets/release/index.android.bundle.map" ]
]
But I get the following error when running ./gradlew assembleRelease
:
> Task :cntral:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Failed to capture fingerprint of input files for task ':cntral:bundleReleaseJsAndAssets' property '$1' during up-to-date check.
> Failed to create MD5 hash for file '/Users/me/Development/app/tmp/skylight-87084.sock' as it does not exist.
To Reproduce
See above.
Expected Behavior
Generates an APK as well as the sourcemaps.
Environment
$ ./node_modules/.bin/react-native info
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: (24) x64 Intel(R) Xeon(R) CPU X5690 @ 3.47GHz
Memory: 7.96 GB / 64.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.11.0 - /usr/local/bin/node
Yarn: 1.10.1 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 15, 17, 22, 23, 27, 28
Build Tools: 26.0.0, 28.0.3
System Images: android-22 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
IDEs:
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.57.8 => 0.57.8
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Android gradlew assembleRelease --sourcemap output fail ...
In './android/app/build.gradle', I have the extraPackagerArgs property to generate source maps. project.ext.react = [ entryFile: "Ā ...
Read more >react native convert meaningless stack trace to original source ...
To generate a source map in react native for IOS, run this command, and the source map will be generated at the root...
Read more >How to add sourcemap in React Native for Production?-Reactjs
ios --sourcemap-output ./sourcemap.js. Android - I had to actually modify the android/app/react.gradle file to get source maps generating on release compile ...
Read more >Inspect React Native App Crash with Source Map - Wade Huang
You can pass --sourcemap-output to change the output path. If your project uses CI/CD to build and distribute the app, it is recommended...
Read more >Source Maps - React Native
... into an error in the release build you will see a stacktrace like: ... Writing sourcemap output to:, android/app/build/intermediates/Ā ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
An update for you. I moved the
extraPackagerArgs
from theapp/build.gradle
to the root projectāsbuild.gradle
file with:And it worked fine. So it had to do with trying to add the
ext
variables in the appāsbuild.gradle
.Anyway, doesnāt seem related to
react-native
so Iām going to close this Issue.Thanks for looking at it regardless. š
Weird. So I deleted that
.sock
file and re-ran. Now Iām getting the following error:So,
ntwrk
is a completely different project. Not related to the project Iām working on at all. Whatās going on that itās looking at these files?And, to confirm, if I just manually update the
react.gradle
file and change the following:to
It works fine and the sourcemaps are generated.
Itās just trying to add the
extraPackagerArgs
that causes these errors. So youāre right, in that, itās not--sourcemap-output
related, but insteadextraPackagerArgs
orproject.ext.react
related.Anything else I can try to help diagnose?
Thanks!