expo: `updates.url` property in app.json bug

Summary

I’ve stuck with this in the last 2 days. trying to get this to work : https://docs.expo.dev/distribution/hosting-your-app/ I’m also using the EAS build.

It doesn’t work at all.

at the end I tried to put "fallbackToCacheTimeout": 300000 the weird thing is that the app loads instantly without waiting on the splash screen and it never loads the new version no logs about, any request to my github page also!

app.json :

{
  "expo": {
    "name": "ota-app",
    "slug": "ota-app",
    "version": "1.0.4",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 300000,
      "url" : "https://stevemoretz.github.io/expo-ota-app/"
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.stevemoretz.otaapp"
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#FFFFFF"
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    }
  }
}

eas.json :

{
  "cli": {
    "version": ">= 0.48.2"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "channel": "preview",
      "ios": {
        "distribution": "internal",
        "simulator": true
      },
      "android": {
        "distribution": "internal",
        "buildType": "apk"
      }
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}

Building with : eas build --profile preview

The result is : This is the native app. But it should clearly become : https://github.com/Stevemoretz/expo-ota-app/blob/0edd043615935e1d6d94f30b58baeff6609b1831/App.js#L7 ie : This is the OTA Update!

After installing and opening the app on the simulator despite the value of fallbackToCacheTimeout it instantly shows This is the native app.

Here are the logs when I open the app: https://gist.github.com/Stevemoretz/f2c601cb69bdbf70cfb1823ddc6e9757

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

iOS

SDK Version (managed workflow only)

44

Environment

expo-env-info 1.0.2 environment info: System: OS: macOS 10.15.7 Shell: 5.7.1 - /bin/zsh Binaries: Node: 14.17.2 - /usr/local/opt/node@14/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 6.14.13 - /usr/local/opt/node@14/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2 Android SDK: API Levels: 28, 29, 32 Build Tools: 28.0.3, 29.0.2, 29.0.3 IDEs: Android Studio: 4.0 AI-193.6911.18.40.6626763 Xcode: 12.4/12D4e - /usr/bin/xcodebuild npmPackages: expo: ~44.0.0 => 44.0.6 react: 17.0.1 => 17.0.1 react-dom: 17.0.1 => 17.0.1 react-native: 0.64.3 => 0.64.3 react-native-web: 0.17.1 => 0.17.1 npmGlobalPackages: eas-cli: 0.48.2 expo-cli: 5.3.0 Expo Workflow: managed

“expo-updates”: “~0.11.6”,

Reproducible demo

Here’s my minimal example : https://github.com/Stevemoretz/expo-ota-app

  1. expo export --public-url https://stevemoretz.github.io/expo-ota-app/
  2. commit to -> https://github.com/Stevemoretz/expo-ota-app/tree/gh-pages
  3. open the app it won’t get the OTA

Here’s the app : https://expo.dev/artifacts/eas/dsxKfHBshiSTn1rrw73Hh2.tar.gz built for simulator. Here’s the online preview : https://appetize.io/app/dg48fnkyecr48pmh54fh811pz0?device=iphone8&osVersion=13.7&scale=75&proxy=intercept


I have also tried with local servers at first for my real app, but couldn’t get it work there also.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (5 by maintainers)

Most upvoted comments

@vasilevich The schema we use expo tools is this schema.

It is possible that you’re experiencing this issue: https://github.com/expo/vscode-expo/issues/87

Hi everyone, I wanted to chime in to clear up some confusion and also help guide how you can create your own updates server.

Every Expo app that has the expo-updates library installed makes a request to fetch any new update manifests. If a new update manifest is available, then the expo-updates library (running on a user’s device) will fetch any missing assets specified in the manifest.

The expo-updates library can request update manifests from any update server. Previously (pre-2022) we were developing Expo’s Classic Updates service, and now we are developing EAS Update. Both services responded to requests from expo-updates with manifests and assets. However, you can also create your own update server (like this issue is asking about).

The most current doc on creating your own update server is https://docs.expo.dev/eas-update/custom-updates-server/, which provides an example server: https://github.com/expo/custom-expo-updates-server.

When we started updating the expo-updates library to have more functionality (as we developed EAS Update), we changed the shape of the update manifest so that it complies with this protocol: https://docs.expo.dev/technical-specs/expo-updates-0/

That is some background, now let me address some individuals in this thread:

@Stevemoretz I’m glad you found the newer reference server. Sorry that it was not linked in the doc you found originally. We are still in the process of rolling out EAS Update and this non-EAS Update doc got bundled in with the EAS Update docs. I can put up a PR to fix that. Also, it looks like I already addressed your asset loading issue here: https://github.com/expo/custom-expo-updates-server/issues/3#issue-1190630070

@raphaelmsr I hope the explanation above helps clarify the differences between expo-updates (open source library), Classic Updates (legacy service by Expo), and EAS Update (current service by Expo). Please let me know if you have more questions about what things are.

@vasilevich Give the example server a shot. Its README.md should provide instructions on how to get it set up: https://github.com/expo/custom-expo-updates-server. Let me know or create an issue on it if it is not working for you. Also, the field you need is expo.updates.url not expo.app.updates.url (remove app) in your app config.