-
-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move modules.json to build folder #2920
Comments
Hi, The reason why we choose We put in place a clean-up job, I would like to explore why it didn't get executed. sentry-react-native/sentry.gradle Lines 202 to 207 in 9fc1c11
|
Thanks for clarifying, I understand better why you put it here then. It still feels like there should be a better suited location for files to be included in the built APK/AAB. Where does RN put the compiled JS bundle? I missed the cleanup task when reading the gradle file, then again I'm not an expert in the Android build system. Please let me know if there's anything I can do to help! In the meantime, I'll add this path to my gitignore now I know it's safe to delete. |
Could you try to run your build with Gradle Scan, that should help us to discover why the cleanup doesn't run?
|
Here's a fresh scan, built using And just as I ran this command I realised the However, when using Android Studio to generate an Android App Bundle, the Is there a way for me to build using the In case it helps, here's the build output from Android Studio which resulted in the modules.json not being removed: Android Studio AAB build log
|
Looking at the Android Studio log the Did you build APK or Bundle using Android Studio? If I'm looking right you build a bundle. |
Of course! Happy to help. It was indeed a Bundle, my standard production deployment process is to build an AAB through Android Studio, then upload the .aab on Play Store console. |
This is probably because App bundles have their own packaging task, See the SAGP https://github.com/getsentry/sentry-android-gradle-plugin/blob/a8fc82a9d45fdc0208b276fa18eb377bcaea440f/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryTasksProvider.kt#L61-L69 |
Makes sense! Regardless, isn't there a risk of overwriting/deleting user files with the currently chosen location and filename? Maybe adding a |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Hey there little bot, I believe this issue should remain open as it is still relevant. |
I've split this into two issues, this one is about moving the modules.json to the build folder. And the new one is to fix the bundles support. |
Closing this one in favor of fixing #2993. |
@krystofwoldrich thanks for #2993! Is there any plan on also moving the modules.json to the build folder, or has the idea been discarded? |
@habovh Assuming the fixed cleanup works well, we are not planning on moving the file. |
@krystofwoldrich So you're willingly ignoring the user content overwrite/deletion I mentioned earlier? If that's the case then I suggest you add a warning in the documentation so users can (hopefully) avoid having a |
@habovh You are right, we will update the docs, and add prefix to lower the collision probability. |
OS:
Platform:
SDK:
@sentry/react-native
(>= 1.0.0)react-native-sentry
(<= 0.43.2)SDK version: 5.0.0
react-native
version: 0.71.3Are you using Expo?
Are you using sentry.io or on-premise?
If you are using sentry.io, please post a link to your issue so we can take a look:
No issue to share
Configuration:
Not relevant here
I have following issue:
On recent versions of the SDK, a new file appeared in my source control at the following path:
android/app/src/main/assets/modules.json
. As I understand, it's part of a collection process from Sentry to list the modules of the app, as defined here:sentry-react-native/sentry.gradle
Line 47 in 9fc1c11
However, unlike other build artefacts such as source maps, this file is not removed at the end of the build process. It should be noted that this file is not required to run the app, it seems it is only used during the build process while sentry is doing its magic to provide context for our future crashes.
Additionally, this file is located in a folder that is supposed to be checked in source control.
In my opinion there are two issues:
src/
folder of the android app.Suggested changes:
Why am I not opening a PR?
Well, I'm not familiar with the build process, and there might be some reason for this file being placed here instead of there. I was surprised to see a new file appearing in my source control after updating to v5.0.0 for no apparent reason. I'm simply basing this feedback on this snippet about source maps in the same file I mentioned earlier:
sentry-react-native/sentry.gradle
Lines 220 to 228 in 9fc1c11
In any case, I'd love to have some input from more knowledgeable people about this, and in case this file needs to stay here, it'd be great to have official guidance regarding version control: should this file be ignored or included in source control?
The text was updated successfully, but these errors were encountered: