Open j3lev opened 1 year ago
Hi @j3lev, thanks for reaching out!
Unfortunately I'm not able to reproduce your issue, I always end up with a sourcemaps file generated at the android/app/build/generated/sourcemaps/react/release/index.android.bundle.map
, even though I get the same output from the bundle task as you do.
Could you please share the content of your android/app/build.gradle
, android/build.gradle
and package.json
files?
I'd like to be able to reproduce your case before taking any corrective action.
For context, as far as I understand the index.android.bundle.packager.map
file is an intermediate sourcemaps that needs to be composed with android/app/build/intermediates/sourcemaps/react/release/index.android.bundle.compiler.map
to generate a correct sourcemaps file that can be used for unminification (Hermes adds this 2-step process).
So I think we should expect a index.android.bundle.map
in the android/app/build/generated
directory at the end of the build process, but I want to make sure I understand your use case first :)
Thanks a lot!
Thanks for getting back to me so quickly. I'd need to find some time to do some redacting of the files to post them. In the meantime, could you show me a demo react native repo with working android sourcemap upload?
Hi @j3lev,
You can use our React Native examples app repository, the simplest app is this one: https://github.com/DataDog/dd-sdk-reactnative-examples/tree/main/rum-react-navigation
Make sure to follow the installation instructions in the README for it to build.
If you want to sign the app to install it, make sure to specify your keystore variables in your android/gradle.properties
file:
MYAPP_UPLOAD_STORE_FILE=/path/to/file
MYAPP_UPLOAD_STORE_PASSWORD=
MYAPP_UPLOAD_KEY_ALIAS=
MYAPP_UPLOAD_KEY_PASSWORD=
You can for instance reuse rum-react-navigation/android/app/debug.keystore
. Its password, key alias and key password are in the debug signing config in the android/app/build.gradle
file.
You can then run yarn android --mode=release
to install your app in release mode or (cd android && ./gradlew clean assembleRelease)
to simply build the apk.
By the way, I forgot to ask which command you are running to build your app? - if I wasn't running the same one that could explain why I could not reproduce the issue.
Let me know if you can reproduce the issue with the provided example repository.
I have the same issue.
I checked that the react-native/android/app/build/generated/sourcemaps/react/devRelease/index.android.bundle.map
is created, but there is the error
Execution failed for task ':app:uploadDevReleaseSourcemaps'.
> JS sourcemap file doesn't exist, aborting upload.
I'm using the react native config and have 3 different flavors, so for dev
, the sourcemap is generated under ../devRelease/index.android.bundle.map
Is the datadog ready for this?
Hi @sciranka, thanks for reaching out!
We do indeed support Android flavors for sourcemaps upload. You need to use @datadog/mobile-react-native
version 1.8.5
at least.
Let me know if that fixes your issue!
And if not can you share your android/app/build.gradle
file so we can try to reproduce the issue on our end?
Thanks a lot!
@louiszawadzki Thank you very much for the prompt reply. We are using @datadog/mobile-react-native version 1.6.0, so I'm going to update it and test it again. Thank you very much.
Bug description
When setting up a React Native 0.71.7 app with this package, the
datadog-sourcemaps.gradle
attempts to upload a sourcemap file at this location:however the actual generated file (both logged by Metro bundler during CI and officially documented by React Native here) is output to this location:
Because of this, the upload fails with the following exception:
Describe what you expected
I expect there to be a way to override the default sourcemap location or for it to align with the location that is used by the Metro bundler by default
Steps to reproduce the issue
android/app/build.gradle
file, add the following after the apply plugin: "com.facebook.react" line: