eas update doesn't work with a custom expo.updates.url value
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 236
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 91
Description
### Build/Submit details page URL
_No response_
### Summary
I'm looking to add OTA Updates to my React Native application, but I want to implement my own server (I'm not paying the official expo way to deliver OTA updates), but I encountered the issue that the `eas update` command doesn't allow me to upload the update to my server and requires me to modify the value of `expo.updates.url` to a expo server link. My question here is, can I use a custom update server url?
I'm using a dynamic configuration in my `app.config.js`, is that a problem? When I put the requested expo url into `expo.updates.url` the update uploads successfully, but I don't want to send my updates to the official expo server.
Also, I'm using a plugin to modify the androidManifest to include my server url as the mentioned [in this documentation](https://github.com/dhcmega/custom-expo-updates-server?tab=readme-ov-file#the-setup)
Someone has experience on delivering OTA Updates through a custom server?
### Managed or bare?
Bare
### Environment
expo-env-info 1.2.0 environment info:
System:
OS: Windows 11 10.0.22631
Binaries:
Node: 18.20.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 29, 31, 33, 34
Build Tools: 30.0.3, 31.0.0, 33.0.0, 33.0.1, 33.0.2, 34.0.0, 35.0.0
System Images: android-30 | ARM 64 v8a, android-30 | Intel x86_64 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
IDEs:
Android Studio: AI-231.9392.1.2311.11330709
npmPackages:
babel-preset-expo: ^10.0.0 => 10.0.2
expo: ~50.0.17 => 50.0.19
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.73.6 => 0.73.6
react-native-web: ~0.19.6 => 0.19.12
Expo Workflow: bare
### Error output
It looks like you are using a dynamic configuration! Learn more: https://docs.expo.dev/workflow/configuration/#dynamic-configuration-with-appconfigjs)
Add the following EAS Update key-values to the project app.config.js:
Learn more: https://expo.fyi/eas-update-config
{
"updates": {
"url": "https://u.expo.dev/eb476e9e-a825-42bb-9ee4-5a245edaf30e"
}
}
Cannot automatically write to dynamic config at: app.config.js
Error: update command failed.
### Reproducible demo or steps to reproduce from a blank project
1. You should have an .apk installed on your android device that aims to your OTA server. This can be achieve by configuring your `androidManifest.xml` to listen to your updates server. Create a file called `AndroidManifestConfig.js` and add the following code:
```
/* eslint-disable import/no-commonjs */
const { withAndroidManifest } = require("@expo/config-plugins");
module.exports = (config) => {
return withAndroidManifest(config, (config) => {
const manifest = config.modResults;
const application = manifest.manifest.application[0];
if (!application) {
throw new Error("No se encontró el nodo en AndroidManifest.xml");
}
if (!application["meta-data"]) {
application["meta-data"] = [];
}
const updateMetaData = (name, value) => {
const metaDataItem = application["meta-data"].find((item) => item.$["android:name"] === name);
if (metaDataItem) {
metaDataItem.$["android:value"] = value;
} else {
application["meta-data"].push({
$: {
"android:name": name,
"android:value": value,
},
});
}
};
updateMetaData("expo.modules.updates.ENABLED", "true");
updateMetaData("expo.modules.updates.EXPO_RUNTIME_VERSION", "@string/expo_runtime_version");
updateMetaData("expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH", "ALWAYS");
updateMetaData("expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS", "30000");
updateMetaData(
"expo.modules.updates.EXPO_UPDATE_URL",
"the_url_to_your_server"
);
return config;
});
};
```
2. Add the following values to your `app.config.js`:
```
expo: {
updates: {
url: "localhost:3000",
fallbackToCacheTimeout: 0,
},
runtimeVersion: "1.0.0",
extra: {
eas: {
projectId: "eb476e9e-a825-42bb-9ee4-5a245edaf30e",
},
},
owner: "juanvelozo",
slug: "yourSlug",
android: {
package: "com.yourapp",
},
},
```
3. run `eas update`
Contributor guide
Assessment
This issue has not been assessed yet.