I recently created a small app for Android using React Native. This process was not as difficult as a thought it would be, based on what I’ve heard from others. I used this only to generate the ADK file, without taking the additional step to submit the app to Google Play.
I started with this command, which creates the expo app in the current directory using a blank template. The blank template essentially has the App.js file without using the app directory, which you would see if you used the standard template.
npx create-expo-app@latest . --template blank
Then I created my app, which was housed solely in the App.js file. I used ChatGPT to generate an array of objects, each of which container an id and an encouraging statement. The name of the app is “encouragement”, and it is meant to be a list of encouraging statements. Each statement displays alone of the screen until you tap to randomly bring up a new statement.
I used the below code to start the application and view it as I was building:
npx expo start
After I finished, I created an account here: expo.dev. Then I installed the EAS CLI like so:
npm install --global eas-cli
eas login
eas update:configure
npx expo-doctor
Expo Doctor allowed me to see any issues that needed to be fixed before created the build. I tried starting with a development build, but this didn’t do a lot for me. The main issues is that the development build didn’t tell me anything about the issues that might come up during the production build. I decided to go straight to the production build and see if I could get it to work.
eas build -p android --profile preview
I was then able to go to expo.dev, and in the dashboard, click on my project to see the progress for the current build. I went through several builds to get it right.
Above you can see the culprit, my sunset.png file. Once I opened this in the photos app, saved it as a .jpg, and ran the build again, it worked. I’m still not sure why it didn’t like the .png file, but whatever.
Once I had a successful build, I was able to get the download link to the APK file, download it on my phone and install it!
I found Expo to be a relatively simple way to build an Android App using React Native. I started with a simple app to get a feel for React Native and the build process. I will be creating some more complex apps in the future to see how the build process goes.