Hi,
I got stuck in the eas update configuration.
If I type eas update:configure
I get the following error:
It looks like you are using a dynamic configuration! Learn more: https://docs.expo.dev/workflow/configuration/#dynamic-configuration-with-appconfigjs)
In order to finish configuring your project for EAS Update, you are going to need manually add the following to your app.config.js:
Learn more: https://expo.fyi/eas-update-config.md
{
"runtimeVersion": {
"policy": "sdkVersion"
},
"android": {
...
},
"ios": {
...
},
"updates": {
"fallbackToCacheTimeout": 0,
"url": "https://u.expo.dev/c21606c0-d0cc-11e9-a631-b54ba6577995"
}
}
Error: Cannot automatically write to dynamic config at: app.config.js
I get that something is wrong with my app.config.js
file, which is configured like this:
module.exports = () => {
if (process.env.APP_ENV === "production") {
return require("./app-production.json");
} else if (process.env.APP_ENV === "staging") {
return require("./app-staging.json");
} else {
return require("./app-development.json")
}
}
the json files differ only in name, slug, bundleIdentifier (iOS), package (android) and look like:
{
"expo": {
"name": "Name",
"scheme": "name",
"description": "This project is really great.",
"slug": "name",
"privacy": "unlisted",
"sdkVersion": "45.0.0",
"platforms": [
"ios",
"android"
],
"version": "1.2.11",
"orientation": "portrait",
"icon": "./images/appicon.png",
"splash": {
"image": "./images/splash_new.png",
"resizeMode": "cover",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"plugins": [
"./plugins/withAndroidVerifiedLinksWorkaround"
],
"ios": {
"bundleIdentifier": "com.comp.name.prod",
"buildNumber": "1",
"supportsTablet": false,
"config": {
"googleMapsApiKey": "AIzaSyAsaMRyRtPIyba-DI3U0LgG-Yi4g3S8EIE"
},
"infoPlist": {
"LSApplicationQueriesSchemes": [
"comgooglemaps",
"citymapper",
"uber",
"lyft",
"waze",
"instagram",
"instagram-stories"
],
"NSCameraUsageDescription": "The app needs permission to your camera in order to take photos for your profile image",
"NSPhotoLibraryUsageDescription": "The app needs permission to your camera roll in order to add a profile image",
"NSLocationWhenInUseUsageDescription": "Trppn will use our location to show you venues and events in your direct area"
},
"associatedDomains": [
"applinks:trppncreator.net"
]
},
"android": {
"package": "com.comp.name",
"versionCode": 45,
"useNextNotificationsApi": true,
"googleServicesFile": "./google-services.json",
"config": {
"googleMaps": {
"apiKey": "AIzaSyDaI_Oa-Mm64hXSnPnRIruENWT_RupWPlU"
}
},
"permissions": [
"ACCESS_COARSE_LOCATION",
"ACCESS_FINE_LOCATION",
"CAMERA"
],
"intentFilters": [
{
"action": "VIEW",
"autoVerify": true,
"data": [
{
"scheme": "https",
"host": "trppncreator.net",
"pathPrefix": "/universal"
}
],
"category": [
"BROWSABLE",
"DEFAULT"
]
}
]
},
"notification": {
"iosDisplayInForeground": true
}
}
}
Note: Since I haven’t figured out how to set/adjust this dynamic config for eas build, I manually copy the resp. app-*.json file into app-development.json and type eas build
and this at least works for making builds. But for eas, it seems that APP_ENV= is being ignored.
Now I don’t know how eas update
works, but it looks like it’s not taking the app-develompment.json file like eas build…
The goal would be to get configure the project (json files and app.config.js)
in a way that
-
command:
eas update:configure
works so that I can useeas update
-
an equivalent to command
APP_ENV=... eas build
(so I dont have to do copy+pasting of json files) -
If possible: not change the process in a way, that expo still works like before, e.g.
APP_ENV=production expo start
, if this isn’t possible its not too bad, I can still use the dev-client
Additional Infos:
- Managed Workflow
- eas-cli 1.2.0
Hope that someone has an idea!
BR,
Marko