This is an Expo project created with create-expo-app
.
if (stateText?.length > 0) {
_handleChangeText(stateText);
}
npm install -g eas-cli
eas login
eas build:configure
, which creates an
eas.json
file with configsandroid
folder locally with npx expo prebuild
or skip this step because it happens automatically in the pipeline.env
file in Secrets of your Expo project on the Expo dev page in order to build the app correctlyeas build -p android --profile development
npx expo start
Install Expo Go on your physical device from Google Play for Android or App Store for iOS.
Install dependencies by running npm install
in the terminal.
Set the EXPO_PUBLIC_GOOGLE_API_KEY
environment in a .env file. This project uses Google APIs, so you need to configure an API Key in your Google Cloud account.
Run npm start
to start the app.
On your device, open Expo Go and scan the QR code to connect to the development server. When the project starts loading, you see this in the terminal, see the gif below.
Using GitHub Actions we have created a workflow for building an APK app for Android. It uses Expo Application Services (EAS) and specifically EAS Build, which builds the app binary for the project.
The build command starts the build process on the EAS Build servers by default. Since EAS is a paid service, the free tier is restricted to 30 builds per month. In order to avoid this limited number of builds, the eas build
command in the pipeline uses the --local
flag. This allows for running the same build process locally on the machine instead of in the Expo's managed environment. Although building locally has some limitations, the local builds do not count to the said free 30 builds per month.
Unfortunately, Expo secrets can only be accessed by EAS cloud builds, and the local builds inside the GitHub runners can't access the Google Geolocation API key we need for the maps. Therefore, we set the EXPO_PUBLIC_GOOGLE_API_KEY
variable as a repository secret and include it in the workflow.