Constants.manifest.env environment variables during the build process

Running on:

  1. SDK Version: 35
  2. Platforms (Android and iOS)

Using "expo-constants": "~7.0.0" in my package.json, I am launching via our CI server an expo build process for both Android and iOS, like so:

EXPO_GIT_COMMIT=MY_VALUE && expo build:android --non-interactive

I log the MY_VALUE during the build, so I know it’s the proper one and exists, and, in local expo start mode on my dev phone, it passes the environment variable properly. It’s only in the then-generated APK and IPA versions of the app that “fail” to access the value.

I am under the impression from the source code and the docs, that environment variables get transferred to Constants.manifest.env and are then accessible there. But that does not seem to be the case. Other items in the manifest are available, such as Constants.manifest.revisionId.

Is this not the correct way to pass in environment variables at build time, to then be accessible from within the components that load the Constants object from expo-constants? Thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.