You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment variables are not being properly injected into EAS builds despite following multiple documented approaches:
Set env variables in eas.json build profiles
Defined variables in EAS Dashboard under the correct profile
Hardcoded values directly in eas.json for testing
Triggering EAS builds from Azure CI pipeline
As a trick to confirm i hae the right env variables. i had a screen with touchable opacity when i click it alerts the EXPO_PUBLIC_API_URL . THE PROBLEM IT SHOWS EMPTY STRING AND Every screen that needs an api call isn't working.
Important Note: The builds are triggered remotely on EAS servers via Azure pipeline, NOT built locally within Azure. The Azure pipeline simply initiates the EAS build process.
Expected: Environment variables (EXPO_PUBLIC_API_URL, EXPO_PUBLIC_APP_NAME) should be accessible in the app for different environments (preview/production).
Actual: Only Clerk secret keys are being successfully injected. All other environment variables are undefined in the built app.
1.env files are not pushed to branches
2. Two separate branches (preview/prod) with different API endpoints
3. Following EAS documentation stating .env files are optional
4.Using eas.json for build configuration
5.Builds are triggered on EAS servers via Azure pipeline, not built locally in Azure
6Environment specific variables need to be available on the app.
If you look into your Spin up build environment phase logs you can see that both EXPO_PUBLIC_API_URL and EXPO_PUBLIC_APP_NAME are present there. How do you access these variables in your app?
Can you also upgrade EAS CLI to the latest version? You seem to have eas-cli: 12.5.1 installed (at least locally).
Build/Submit details page URL
https://expo.dev/accounts/zakisb97/projects/gogain/builds/16e1e538-4314-420d-9bd1-996f3e773739
Summary
Environment variables are not being properly injected into EAS builds despite following multiple documented approaches:
Set env variables in eas.json build profiles
Defined variables in EAS Dashboard under the correct profile
Hardcoded values directly in eas.json for testing
Triggering EAS builds from Azure CI pipeline
As a trick to confirm i hae the right env variables. i had a screen with touchable opacity when i click it alerts the EXPO_PUBLIC_API_URL . THE PROBLEM IT SHOWS EMPTY STRING AND Every screen that needs an api call isn't working.
Important Note: The builds are triggered remotely on EAS servers via Azure pipeline, NOT built locally within Azure. The Azure pipeline simply initiates the EAS build process.
Expected: Environment variables (EXPO_PUBLIC_API_URL, EXPO_PUBLIC_APP_NAME) should be accessible in the app for different environments (preview/production).
Actual: Only Clerk secret keys are being successfully injected. All other environment variables are undefined in the built app.
Attempted Solutions:
Using variable references in eas.json:
Hardcoding values directly in eas.json:
Additional Context:
1.env files are not pushed to branches
2. Two separate branches (preview/prod) with different API endpoints
3. Following EAS documentation stating .env files are optional
4.Using eas.json for build configuration
5.Builds are triggered on EAS servers via Azure pipeline, not built locally in Azure
6Environment specific variables need to be available on the app.
Managed or bare?
bare
Environment
expo-env-info 1.2.1 environment info:
System:
OS: macOS 14.0
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
Yarn: 1.22.22 - /opt/homebrew/bin/yarn
npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
Watchman: 2024.11.18.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.15.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.5, iOS 17.5, macOS 14.5, tvOS 17.5, visionOS 1.2, watchOS 10.5
IDEs:
Xcode: 15.4/15F31d - /usr/bin/xcodebuild
npmPackages:
babel-preset-expo: ^11.0.13 => 11.0.15
expo: ^51.0.18 => 51.0.39
expo-router: ~3.5.20 => 3.5.24
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.74.5 => 0.74.5
react-native-web: ~0.19.10 => 0.19.13
npmGlobalPackages:
eas-cli: 12.5.1
Expo Workflow: bare
Error output
Errors happens on pages requiring api call.
Reproducible demo or steps to reproduce from a blank project
Simple demo project . add eas.json variables like shown in summary and ignore .env files via gitignore. that's it.
The text was updated successfully, but these errors were encountered: