expoexpo-updates

Issue with expo-updates package: Updates not being applied to the app


I need help with the expo-updates package as it's not updating my app.

I'm calling the checkForUpdates function on mount, and initially, it behaves as expected.

However, the function should throw an error at !result.isNew after the update, but it doesn't. I added a console log to check the updateId, and it remains the same, indicating that the update is not being applied.

Here's the code snippet:

async function checkForUpdates() {
  console.log("Updates.updateId", Updates.updateId); // not changing

  const update = await Updates.checkForUpdateAsync();
  if (!update.isAvailable) throw new Error('No updates available');

  const result = await Updates.fetchUpdateAsync();
  if (!result.isNew) throw new Error('Fetched update is not new');

  return true;
}

I'm using Expo SDK version 49.0.0 and "expo-updates": "~0.18.16".

I found a similar issue on GitHub at https://github.com/expo/expo/issues/20847, but it seems to involve a conflict with Constants.manifest, which I'm not using in my code.

Any help would be greatly appreciated!


Solution

  • It is possible to debug the issue by reading the readLogEntriesAsync function, and an error message stating rctErrorDomain could not get batchedBridge is encountered.

    To resolve this, I made a fix by changing the jsEngine to jsc in the app.json file.