Hi! yep you can definitely do this. The sentry upload step takes place after publishing, so you just need to only publish once. expo build:* runs expo publish under the hood, but you can avoid that by passing the --no-publish flag.
So if you want to publish once, you can either run:
However if I do this, then the other build that got --no-publish will not find it’s Sentry map on Sentry when it reports. Is it possible to tell the 2nd build to use Sentry bundle id from previous?
You’ll have to provide more information otherwise I can’t say what’s going on
what does your sentry dashboard say? are the release and dist that the error is under the same as the release and dist of the uploaded sourcemap artifacts? are the sourcemap artifacts even present?
In this case, the Sentry sourcecode was uploaded only on ios. Lets say with sentry id X.
In android case it wasn’t.
Now in runtime of the production bundle, if in the Android bundle an error occurs, will it log to Sentry that this happened in sentry id X? It wouldn’t know its bundle is for Sentry bundle id X right?
Thanks. So I was just thinking ahead because right now, i have to sentry ids for two bundles which are exactly teh same. Ios reports to one id, and android reports to the other.
How does Sentry for my android build know, to mark any errors with the id for that android bundle that got uploaded with my ios build?
Sorry, but I’m not really following your question. What ID are you referring to?
Your sentry errors / sourcemaps are related to bundles, not to builds. The android build your making is pulling the most recently published bundle, which is the one you just published by building for ios without the --no-publish key.
If your Sentry set up is more complicated than normal, you may need to just opt for uploading sourcemaps yourself with sentry-cli
Thanks so much for sticking with me on this. Sorry my expalnations are real bad haha.
This is what I do today:
build ios (this uploads source code to Sentry and gets assigned id X by Sentry)
build android (this uploads same source code to Sentry but gets id Y by Sentry)
Now when errors happen on Android, sentry says this happend in “Y”.
And if error in iOS it says it happend in “X”.
So with your new technique im wondering:
ios build and publish sourcecode to Sentry and gets Sentry id Z
android build but no publish sourcemap to Sentry
Now if ios errors it will tell me it errored in Sentry ID Z. But now if Android errors, what Sentry ID will it say the error happened in?
Ohh no way! I was asuming that even with --no-publish it will build the sourcemap again!
Gosh so true I should test this. Haha im scared to test got so many people on prod thanks Expo team!! Single man team here couldn’t do it without you!