expo-updates crashes the app on iOS

  1. SDK Version: 40
  2. Platforms(Android/iOS/web/all): iOS
  3. Managed workflow
  Expo CLI 4.3.0 environment info:
    System:
      OS: macOS 11.2.1
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.18.3 - /usr/local/bin/node
      npm: 6.14.6 - /usr/local/bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    IDEs:
      Xcode: 12.4/12D4e - /usr/bin/xcodebuild
    npmPackages:
      expo: ^40.0.1 => 40.0.1 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz => 0.63.2 
      react-native-web: ~0.13.12 => 0.13.18 
    npmGlobalPackages:
      expo-cli: 4.3.0
    Expo Workflow: managed

Suddenly out of the blue, our app keeps crashing 1 second after start in production or when published by expo publish. The problem is only on iOS (all versions), android works just fine. After some debugging, we figured out it it crashes on this section of code in App.js:

componentDidMount() {
    Updates.checkForUpdateAsync()
            .then((update) => {      
                if (update.isAvailable) {
                    Updates.fetchUpdateAsync()
                    .then((reload) => {
                        Updates.reloadAsync();
                    })
                    .catch((e) => {
                        console.log(e);
                    })
                }
            })
            .catch((e) => {
                console.log(e); - this line will catch
            })
}

Catched the error for the function checkForUpdateAsync():

[Error: The updates module controller has not been properly initialized. If you’re in development mode, you cannot check for updates. Otherwise, make sure you have called [[ABI40_0_0EXUpdatesAppController sharedInstance] start].]

Didn’t have any issue with updates before and this section of code didn’t change for about 1 year.

Deleting & installing node_modules didn’t help.

Any help would be greatly appreciated as I’m currently in dead end.

1 Like

We have the exact same scenario. Our code haven’t changed in 2 months. Out of the blue, the iOS version started crashing.

Edit:
As per this issue #12604, quoting @esamelson:

Hey all – thanks for the report, I’ve verified this crash. The affected methods are Updates.checkForUpdateAsync and Updates.fetchUpdateAsync in SDK 39 and 40 apps in version 2.19.1 of Expo Go for iOS. Note that standalone apps built with expo build:ios are unaffected by this bug , so you don’t need to worry about users encountering this. These methods also work fine in SDK 38 and 41 apps in Expo Go.

We have a fix in the works but it may take a while for it to be deployed to the App Store version of Expo Go. In the meantime, you’ll need to work around this by either avoiding use of these two methods in Expo Go for SDK 39/40 apps, upgrading such apps to SDK 41, or using the simulator build of Expo Go (which has been updated to version 2.19.2).

I’m really sorry for the inconvenience :disappointed: we’re working to resolve this as quickly as we can!

I’m upgrading to SDK 41 to test it out and will be posting the results here.

Confirming that following the upgrade instructions at the SDK 41 release blog post led us to successfully upgrade from SDK 39 to SDK 41 and get rid of this crash.

1 Like

we also fixed this for sdk 39 and 40 in the latest version of expo go - 2.19.3. it was just released to the app store and you can get it in your simulator with expo client:install:ios

Note that standalone apps built with expo build:ios are unaffected by this bug , so you don’t need to worry about users encountering this.

We are currently experiencing this bug in a standalone app in production, so iOS users are unable to get updates OTA, as the app crashes 1 second after launch.