Expo Updates Not working With Expo Custom-Dev-Client and EAS Build
See original GitHub issueSummary
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:
- Created 2 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
@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.Hi @vipinjoshiMeta , I’m facing the same issue.