Build Setup
Some Common Practices
- Gitignore these folder & files:
- if there's no native overrides / modification:
- /android
- /ios
eas.json
credentials.json
To Export as APK: Set Distribution as Internal
References:
-
https://docs.expo.dev/build-reference/apk/#configuring-a-profile-to-build-apks
To generate an .apk, modify the eas.json by adding one of the following properties in a build profile:
developmentClient
totrue
(default)distribution
tointernal
android.buildType
toapk
android.gradleCommand
to:app:assembleRelease
,:app:assembleDebug
or any other gradle command that produces.apk
-
https://docs.expo.dev/build-reference/variables/#can-eas-build-use-env-files
Environment variables defined in a .env file are only considered by the Expo CLI. Therefore, if you upload a .env file to EAS Build, it can be used to inline EXPOPUBLIC variables into your application code.
However, the recommended practice is to use .env files in your local environment, while defining environment variables for EAS Build in eas.json. Environment variables defined in your eas.json build profile will be used when evaluating your app.config.js when running eas build and will be available to all steps of the build process on the EAS Build server.
Notes:
- The way EAS build work in local is the CLI will copy the project code. So whatever file is being gitignored will also be ignored. If the env values are being stored in an env file which are being ignored, then it will not get caught. The alternative is to utilize EAS secrets.