React-Native Expo Built App Doesn't Get the Latest Javascript - react-native

Ok, I have a problem with expo build. Please let me know if you need more details. Basically, the project I am working on is NOT detached. It is just using Expo.
So I publish it. Let's say the javascript bundle version is 0.17, and I am publishing a breaking change to 0.18.
When I load the app from Hockey App, the javascript bundle is clearly not 0.18 because I don't see my breaking changes. Then, I close the app and re-open it, and the JS bundle is updated.
The build script is:
exp build:android
[exp] Android:
[exp] APK: [AWS LINK] apk has been generated, it took 0 seconds
Then, I get an AWS link to the APK, which I download and upload to Hockey Apps.
How should I diagnose this problem?
Exp version is 44.0.0

It is the way it works in Android. First time you open your app after you publish, the code is downloaded in background. Next time it will run the new code.
Quoting the documentation:
Updates are handled differently on iOS and Android. On Android, updates are downloaded in the background. This means that the first time a user opens your app after an update they will get the old version while the new version is downloaded in the background. The second time they open the app they’ll get the new version. On iOS, updates are downloaded synchronously, so users will get the new version the first time they open your app after an update.

Related

Where can I source help for native crashes of an expo EAS apk build

I am building an app using react-native on Expo and making sure to build with EAS every few days or whenever I add a new dependency.
After every build, I install the apk on an Android device and run the ios build on a simulator.
On my latest build, the build completes successfully but after installing the apk on android 10, the app opens and crashes once I navigate to a certain page.
It works fine on 3 other android phones.
The code difference between the last successful build that doesn't crash to the current one is minimal however very necessary for the app.
How can I see logs from the native crash in order to find the cause of the problem and hopefully find a fix?
I tried to install sentry but at the bottom of the page, it explains it only follows js issues and is not native.
Any ideas will be helpful
Thanks

Impossible to update expo project inside Expo Go after switching to EAS Build

I have the need to run a project from Expo Go without being connected to PC. We are developing an app that require GPS and needs to be tested in open field.
Before EAS became the standard to create projects i used
expo build:android
ad this created not only the apk, but uploaded the project to my account and i was able to start it from Expo Go projects section just like the app was installed on phisical device. That worked also fo iOS and was a great testing feature.
After i moved to EAS Build
eas build -p android --profile preview --clear-cache
my project inside Expo Go does not update anymore and its stucked at sdk 44 even if now i'm working (and creating builds) with sdk 46.
I went through the official documentation many times but i don't get how to make the app start from Expo Go (project sction) as i did before. Maybe i'm missing some configuration.
Thank you all for any kind reply.
Have a good day.
EDIT
I found the solution to this problem and now my builds are working and uploading to Expo Go.
Check out this information: https://github.com/expo/fyi/blob/main/eas-build-archive.md
Basically EAS Updates will not bundle anything inside your .gitignore, in my case it needed specific config files. Did a quick test by taking them off the .gitignore and now it's working. Will move to GitHub SECRETS in the future.
Hope that helps.

How does expo publish overwrite my Testflight download?

I have a react-native application which is using Expo. When I want a build on my iOS device, I run
expo build:ios
then I upload the build to my appstoreconnect account and manage the build version through Testflight. Then on my iOS device I'm able to download it.
This all makes sense, as it mirrors the android process of building, creating a downloadable link, and having the end user download the latest link. But if I make a change and run "expo publish"... the app downloaded on my iOS device automatically has the changes that I made to the source code. How is that possible? Why don't I need to rebuild and reupload the .ipa to Apple for them to distribute through Testflight?
Thank you in advance!
It's happening because of the Expo "OTA" updates system (over the air).
When you publish to a release channel, users will automatically get the new update.
If you make some changes in app.json, or if you updated some native codes, you will need to re-build your app. The OTA updates only works for JS updates.

Do OTA updates in Expo get in motion on the first opening after brand new download from the stores?

I developed an app with React Native and distributed it with Expo. I published the final version into Google Play and Apple Store.
Some time later I discovered in Expo's docs on Publishing that expo publish allows you to create an OTA ("over the air") update that is built into Expo and updates the app automatically, according to this answer:
The standalone app knows to look for updates at your app's published url.
This I tested and worked very well.
However, now I see that people downloading the app from the stores (that is, either Google Play or Apple Store) apparently get the initial version of the app, not the updated one.
What is the exact workflow for the OTA updates? Do they go and "replace" the existing version in Google Play and Apple Store the first time they open it? Or do they need to open it over again to get the update?
And what exactly triggers the update of the app?
We've been having similar problems. I can see two things which might be causing this in your case:
Check in app.json if updates.fallbackToCacheTimeout is set. If it's set, that's how long expo will try to download the latest update before showing the last downloaded version (which will be the initial version after initial download).
If you have a large update, expo will try downloading the update for 30s before showing the last version of your app.
Check here for more info: https://docs.expo.io/versions/latest/guides/configuring-ota-updates/
OTA updates do not replace the version downloaded from the app store, they are stored first in the device's cache before being run on app start after download. Source https://docs.expo.io/versions/latest/sdk/updates/
Update downloads are automatically triggered on app start, then, depending on the settings it will either wait (as long as updates.fallbackToCacheTimeout allows) before showing the app, or show it immediately.
You can force the app to run the latest update (if you have one waiting) by just force quitting the app, then restarting.
Hope this helps!

React native code update

I published my first app to AppStore last night.
I just want to know if there is code change in my app,
Should I have to re-build and upload .ipa file to itunes connect again?
(Currently, I do not use CodePush and I build app with exp)
Thanks.
Expo comes with a built in CodePush equivalent.
Whenever you publish to expo (using exp publish, the XDE etc), expo builds new JS bundles and uploads them to their servers.
Users who downloaded the app from the stores will get those updates - while iOS users will get them as soon as they open the app, Android users will get them in the second time (iOS is does this syncly while Android asyncly).
Note that this does not apply to changes in the app config (app.json), including sdk upgrades or any other configuration changes.
Yes, you will need to rebuild the release version of your app and upload to the App Store as a new version.