expo: Expo updates new bundle doesn't load and requires multiple restarts on iOS
🐛 Bug Report
Summary of Issue
See the real description of the problem in the comments below
After pushing OTA updates, I cannot force a manual update on iOS. Have not tested Android. Restarting the app and getting updates works fine, but manual does not. I believe this is failing at :await Updates.checkForUpdateAsync() or could update.isAvailable have changed in between the new release of the updater but the types weren’t updated? This code worked fine in ExpoKit before I moved to the bare workflow and started using the new expo-updates. The following is my manual updater code which fails
export const checkForOTAUpdates = async () => {
try {
const update = await Updates.checkForUpdateAsync();
if (update.isAvailable) {
Alert.alert(
'Updates Completed',
'Updates to the platform have been installed and must be loaded now. Pressing ok will quickly restart the application. You will not lose any visits or data but any video chats will need to be reopened.',
[
{
text: 'Ok',
onPress: async () => {
await Updates.fetchUpdateAsync();
await Updates.reloadAsync();
},
},
],
{ cancelable: false }
);
}
} catch (e) {
console.log(`Error when checking for OTA updates: ${e}`);
}
};
Environment - output of expo diagnostics & the platform(s) you’re targeting
Expo CLI 3.22.3 environment info:
System:
OS: macOS 10.15.4
Shell: 3.1.0 - /usr/local/bin/fish
Binaries:
Node: 14.4.0 - ~/.nvm/versions/node/v14.4.0/bin/node
Yarn: 1.22.4 - ~/.yarn/bin/yarn
npm: 6.14.5 - ~/.nvm/versions/node/v14.4.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5900203
Xcode: 11.6/11E708 - /usr/bin/xcodebuild
npmPackages:
expo: ~38.0.8 => 38.0.8
react: ~16.11.0 => 16.11.0
react-dom: ~16.11.0 => 16.11.0
react-native: ~0.62.2 => 0.62.2
react-native-web: ~0.11.7 => 0.11.7
react-navigation: ^4 => 4.4.0
npmGlobalPackages:
expo-cli: 3.22.3
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (5 by maintainers)
For right now, you do most of the configuration in the native files (expo.plist and androidmanifest), although when publishing we can set these values for you based off of the values you set in app.json if they aren’t provided in the corresponding native files already - https://github.com/expo/expo-cli/blob/b125430c2e18e73975cf2c8af3a7f2ece18888ed/packages/xdl/src/EmbeddedAssets.ts#L369-L377
Even then though, you’d need to rebuild the binary afterwards, since any native code/native file changes will require a binary update to take effect