question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expo Updates Not working With Expo Custom-Dev-Client and EAS Build

See original GitHub issue

Summary

I’m trying to integrate expo-updates in a Expo Custom Dev Client bare managed project. For some how i can be able to build apk with eas build & its working fine.

But Expo updates not working i’m publishing update using expo publish command

expo publish --release-channel channel-name

But in the app i’m not getting any update notification than i try to setup config for update manually

`const triggerUpdateCheck = async () => {

    try {
        const update = Updates.checkForUpdateAsync();
        if (update.isAvailable) {
            await Updates.fetchUpdateAsync()
            alert("An update is available, Restart your app to see it.")
        } else {
            alert("No update is available")
        }
    } catch (err) {
        alert(error.message)
    }
}`

But i'm always getting there is no update available
I also had cross check both apk & publish update release channels.

For the manual update what i have done in a app.json

`"updates": {
  "enabled": true,
  "checkAutomatically": "ON_ERROR_RECOVERY",
  "fallbackToCacheTimeout": 0
},`

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

bare

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

No response

Environment

Expo CLI 5.0.3 environment info: System: OS: Windows 10 10.0.19043 Binaries: Node: 14.15.4 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD npm: 7.24.0 - C:\Program Files\nodejs\npm.CMD SDKs: Android SDK: API Levels: 23, 26, 27, 28, 29, 30, 31 Build Tools: 23.0.1, 28.0.3, 29.0.2, 29.0.3, 30.0.2, 31.0.0, 32.0.0 System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom IDEs: Android Studio: Version 2020.3.0.0 AI-203.7717.56.2031.7583922 npmPackages: expo: ~43.0.2 => 43.0.3 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 react-navigation: ^4.4.4 => 4.4.4 Expo Workflow: bare

Reproducible demo

const triggerUpdateCheck = async () => { try { const update = Updates.checkForUpdateAsync(); if (update.isAvailable) { await Updates.fetchUpdateAsync() alert("An update is available, Restart your app to see it.") } else { alert("No update is available") } } catch (err) { alert(error.message) } }

App.json file changes:

"updates": {
      "enabled": true,
      "checkAutomatically": "ON_ERROR_RECOVERY",
      "fallbackToCacheTimeout": 0
    }
**EAS Config**
{
"cli": {
 "version": ">= 0.38.2"
},
"build": {
 "development": {
   "developmentClient": true,
   "distribution": "internal"
 },
 "preview": {
   "distribution": "internal"
 },
 "production": {
   "android": {
     "buildType": "apk",
     "gradleCommand": ":app:assembleRelease"
   },
   "releaseChannel": "production",
   "env": {
     "APP_ENV": "production"
   }
 },
 "production-debug": {
   "android": {
     "buildType": "apk",
     "gradleCommand": ":app:assembleDebug"
   },
   "releaseChannel": "production",
   "env": {
     "APP_ENV": "production"
   }
 },
 "test": {
   "android": {
     "buildType": "apk",
     "gradleCommand": ":app:assembleRelease"
   },
   "releaseChannel": "test",
   "env": {
     "APP_ENV": "staging"
   }
 },
 "test-debug": {
   "android": {
     "buildType": "apk",
     "gradleCommand": ":app:assembleDebug"
   },
   "releaseChannel": "test",
   "env": {
     "APP_ENV": "staging"
   }
 },
 "staging": {
   "android": {
     "buildType": "apk",
     "gradleCommand": ":app:assembleRelease"
   },
   "releaseChannel": "staging",
   "env": {
     "APP_ENV": "staging"
   }
 },
 "staging-debug": {
   "android": {
     "buildType": "apk",
     "gradleCommand": ":app:assembleDebug"
   },
   "releaseChannel": "staging",
   "env": {
     "APP_ENV": "staging"
   }
 },
 "production-bundle": {}
},
"submit": {
 "production": {}
}
}

Will be a great help if anyone can give some guidelines, how it should be implemented in a better way. Basically we need some automatically update check feature on the app start & a mechanism also to give some interface to manually update the app.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
LinFeiLongcommented, Jan 21, 2022

@vipinjoshiMeta I resolved the issue on my side. It’s not an issue properly talking. I had to add "runtimeVersion": { "policy": "nativeVersion" }, to the app.json. Then the automatic update worked.

1reaction
LinFeiLongcommented, Jan 21, 2022

Hi @vipinjoshiMeta , I’m facing the same issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use EAS Update in an existing project - Expo Documentation
Learn how to use EAS Update in an existing React Native project. ... your project is not using EAS Build or you are...
Read more >
Create development builds - Expo Documentation
Learn how to create development builds for a project. Development builds can be created with EAS Build or locally on your computer, if...
Read more >
different behavior of build and run - Expo Forums
Hello, I created a project through Expo, through the instructions Onesignal is installed in it, the problem is that when I execute expo...
Read more >
Using EAS Update - Expo Documentation
Learn how to use EAS Update with EAS Build. ... JavaScript bundle expects to exist does not exist) then your app may not...
Read more >
Using expo-dev-client with EAS Update
Learn how how to use the expo-dev-client library to preview a published EAS Update inside a development build.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found