-
Notifications
You must be signed in to change notification settings - Fork 83
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
[Expo EAS] Sourcefiles not getting uploaded only for Android #292
Comments
I wonder if the |
Having the exact same issue. Works great on iOS. In Dependencies:
|
Is there some way of fixing this until there is a fix from sentry? tried to run
This upload it like but that does not seem to fix it. I also notice that the iOS postPublish upload looks different: (it does not have a hash in the file name of the map) |
I was trying to reproduce the error, but sadly no luck. Here is a repository that step by step (in the commits) adds https://github.com/krystofwoldrich/sentry-expo-sample-app You can try to compare your app to it and maybe we will find a difference or fork the app and add changes that break it in your app and I can debug it. |
Hey @krystofwoldrich, does Sentry show correctly the source map of Sentry.Native.captureException(new Error()); you are throwing? Also I would like to ask that have you run eas update and tried that source maps then work correctly? EDIT |
@fuelkoy Thank you for trying it out. From the screenshot, it looks like you uploaded the updated map to the original release. The map name must be |
Took my a moment to notice you already answered. But first of all big thank you for helping @krystofwoldrich I understood from 'Using Sentry - Expo Documentation' that .map file hash is left there by the script: Then my problem is that how is the .bundle file uploaded by eas update? I just tested uploading by (and used index.android.bundle.map, not 'hash') and the script uploads only the .map file, not the bundle file. Found 1 release file
Source Map Upload Report I opened issue here and posted a StackOverflow question if someone would know why this is happening, but let me so bold to ask you if you would know. I'm on Windows and using the following script as the one on Using Sentry - documentation didn't work out of the box. Could this script be the culprit as it doesn't find the index.android.bundle file without specifically putting the file extension ( = index.android.bundle.js)
|
Just to clarify the last mentioned command with the cross-env ./node_modules/@sentry/cli/bin/sentry-cli releases --org 'organization name' --project 'project name' files 'release name' upload-sourcemaps --dist 'Android Update ID' --rewrite dist/bundles/index.android.bundle dist/bundles/android-'hash'.map Could you post the links to the Expo and Sentry docs you used, and the StackOverflow question? |
I will double check while writing this. And of course. Here are the links: EDIT I now made a new eas update to sentry-expo-sample-app with index.android.bundle.js. And then threw error to see if it is source mapped (dist and release are correct in the event) SOLVED |
just to get it right @krystofwoldrich : this sample project uploads the Android source maps for you during I've run the project with the following dependencies and its not uploading:
However: iOS upload works. Two minor things that I changed in comparison to your project:
Thus, my postPublish hook looks like this:
@BrodaNoel @lindesvard - did you manage to get it running? |
Nop. 'eas build' still not publishing the sourcemaps |
@RRaideRR sadly not Edit: have not tried the lastest release tho (6.1.0). |
I've tried it and its not working for my setup :-/. Would be nice if you could also test it on your setup. |
Also seeing this on 6.1.1. |
Same problem here, it's a big regression from the legacy system, and the docs on the expo website are half updated leading to lots of confusion. Seems like there is no way to get eas build to send the sourcemaps to sentry, but even worse is that I can't even find a way to just get the sourcemaps to upload them myself like we have to do for the eas update. |
I have a similar problem during the build for the apk , I get no errors but during the build proccess I notice that the size of the uploaded files to EAS is smaller that 200kb and that is not logical . and the build APK is just the splash screen |
@brentvatne @kbrandwijk @byCedric @tsapeta Sorry for the notification, but could somebody at Expo bring this to the attention of the appropriate person to get it bumped up in priority? Sentry source maps have been broken on Android when building with EAS for nearly 6 months now. That really limits the usefulness of Sentry and gets in the way of the otherwise stellar experience of using EAS. If this module is not a priority for active maintenance by Expo perhaps it should be deprecated or spun off into a community repo. As is, it's pretty frustrating to have this "official" Expo integration partially broken for such a long time given that the docs say "Sentry treats React Native as a first-class citizen and we have collaborated with Sentry to make sure Expo is, too.". Thanks! |
The reason that this happens for me is that the @sentry/react-native version that is being used is 4.13.0. This version hooks in by using a task that starts with 'bundle', While in my react native version (0.71.7), I only see the createBundle being ran on build. It looks like the newer @sentry/react-native did change this behavior. I've been trying to upgrade this package. It did upload a source map but other issues arose. |
@jongbelegen Exactly like you say. We added the support for the new RN bundle tasks in 4.14.0 version. Maybe try that instead the major update to v5. Could you elaborate on what other issues arose? Could you share more in the @sentry/react-native repository? |
Sources maps shoud be uploaded automatically while you build app with eas or I need to extra steps for it? Postpublish hooks params I have added in app.json. |
Hi @krystofwoldrich, When using this branch: https://github.com/jongbelegen/sentry-expo/tree/fix/update-sentry-android-support I get the following build error:
This probably has to do with using a pnpm monorepo, the package is in the root node_modules and not in de app node_modules. In my setup I use the custom env variables:
When I try to use @sentry/react-native@5.3.1, it builds correctly and the sourcemaps get uploaded for ios and android. When I trigger an exception it works well on iOS but on android I get the following error on the web ui: Invalid location in sourcemap (see Troubleshooting for JavaScript) When running
I also checked my dist for this triggered event and its "embedded". What would be handy here? Should I make a small reproducable repo using |
@jongbelegen Hi, yes the build error is caused by the mono repo structure, it was fixed in the latter version not to crash the build. For the Android Stack trace, a minimal reproducible example would help a lot with debugging. A link to a repo or zip would work. :) |
@krystofwoldrich Where should we configure |
@krystofwoldrich I tried applying the fix by using an expo config, but it still gives the error. Im using this config plugin: const { withAppBuildGradle } = require("@expo/config-plugins");
// Applying the fix mentioned here https://github.com/getsentry/sentry-react-native/issues/2740
module.exports = (config) => {
const sentryFix = `project.ext.sentryCli=[collectModulesScript: new File(["node", "--print", "require.resolve('@sentry/react-native/package.json')"].execute().text.trim(), "../dist/js/tools/collectModules.js")]`;
return withAppBuildGradle(config, (config) => {
if (config.modResults.contents.includes("project.ext.sentryCli")) {
return config;
}
config.modResults.contents = config.modResults.contents + "\n" + sentryFix;
return config;
});
}; |
@anirudhsama Hi, I'm not familiar with the If you can upgrade to https://github.com/getsentry/sentry-react-native/releases/tag/5.3.1 we fix the build process so it doesn't fail if it can't find the script. |
@expo/config-plugins is a way to modify the
This was required since sentry/react-native is configured in a mono repo and I had to adjust the path of the I will provide a sample project. Also, this repo (sentry-expo) also uses @expo/config-plugins to provide the integration of sentry/react-native and expo. |
Can you try putting the sentry fix first? I made a plugin (just to make it a bit cleaner): const { withAppBuildGradle, withPlugins } = require("@expo/config-plugins");
const sentryFix = `project.ext.sentryCli=[collectModulesScript: new File(["node", "--print", "require.resolve('@sentry/react-native/package.json')"].execute().text.trim(), "../dist/js/tools/collectModules.js")]`;
function withSentryMonorepoFix(config) {
return withAppBuildGradle(config, config => {
config.modResults.contents = `
${sentryFix}
${config.modResults.contents}
`;
return config;
});
}
module.exports = config => withPlugins(config, [withSentryMonorepoFix]); and made sure this is before Next to this i also put a resolution for react-native: |
@maximgeerinck Sure, will try this out! Thanks! |
@maximgeerinck Thanks for the expo-plugin. It fixed the sourcemap upload. However, It's still not working. Got the following error:
|
My issue doesn't seem related as It's also happening on iOS builds. I'll move it to a new issue. Thanks again @maximgeerinck ❤️ |
Did you have to add any other packages while updating @sentry/react-native to 5.4.2? I'm getting this error after updating it. #332 |
@mccraveiro Did you find why ? I have the same issue |
@celoprd not yet 😞 I've seen this issue that seems related but I couldn't fix on my project. |
We have released sentry-expo@6.2.0 which includes a version bump of @sentry/react-native that fixes Android build-time sourcemaps uploads. Feel free to open a new issue if you're still seeing issues with Android build-time sourcemap uploads after upgrading sentry-expo and @sentry/react-native. |
Summary
For some reason, the sourcemap files are getting uploaded for iOS, and not for Android.
The fact that iOS are working well, kind of confirm me that the configuration is correct.
I have:
Then in the app.json:
Managed or bare workflow? If you have
ios/
orandroid/
directories in your project, the answer is bare!managed
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
46
Environment
expo-env-info 1.0.5 environment info:
System:
OS: macOS 11.6.1
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.4.0 - ~/.nvm/versions/node/v16.4.0/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 7.18.1 - ~/.nvm/versions/node/v16.4.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK:
API Levels: 27, 31
Build Tools: 23.0.1, 23.0.3, 25.0.3, 26.0.1, 27.0.3, 28.0.3, 29.0.2
System Images: android-31 | Google Play Intel x86 Atom_64
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8309675
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
npmPackages:
expo: ^46.0.0 => 46.0.2
react: 18.0.0 => 18.0.0
react-native: 0.69.5 => 0.69.5
npmGlobalPackages:
eas-cli: 2.4.0
expo-cli: 6.0.6
Expo Workflow: managed
Reproducible demo or steps to reproduce from a blank project
I won't be able to create a Snack for this.
The text was updated successfully, but these errors were encountered: