Builds
Production
iOS
- create the build
npx eas build -p ios --profile production- this could take between 30mins to a few hours depending on queue. - submit the build to App Store Connect
npx eas submit -p iosornpx testflight
Android
eas build -p android --profile production
Development
- iOS:
npx eas build -p ios --profile development - Android:
npx eas build -p android --profile development
build locally
- when android phone is plugged in to computer:
npx expo start --dev-client --clearand scan the qr code- runs on the Android phone
- after plugged in once you can just scan the qr code
- Build locally to for Google Play Store:
eas build -p android --profile preview --local- this will take a good 5-10 mins then create a .aab file to place in the Google Play Store
Builds Troubleshooting
Error 10
This was due to incorrect SHA-1. I was using the SHA-1 from the expo.dev project page instead of the SHA-1 from the google cloud console.
- solution: go to Google PLay Console > Test and release (App Integrity) > Play App Signing
- here select the SHA-1 from the "App signing key certificate"
App Icon and Name
iOS change icon
- place the icon.png file in the
src/assets/icon.png - update the app.json file:
{
"expo": {
"name": "sleeprituals02",
"icon": "./src/assets/icon.png",
"ios": {
"icon": "./src/assets/icon.png",
"infoPlist": {
"ITSAppUsesNonExemptEncryption": false,
"CFBundleDisplayName": "Sleep Rituals"
}
},
"android": {
"icon": "./src/assets/icon.png",
"adaptiveIcon": {
"foregroundImage": "./src/assets/icon.png",
"backgroundColor": "#ffffff"
}
}
}
}
iOS Name change
use the CFBundleDisplayName in the app.json file.
- If build is already made you might need to delete the build and make a new one.
Public Wifi (ngrok)
This is how you can get around the issue of not being able to access your API from your phone when you are on public wifi.
Tunnel Expo Go
install ngrok
npm i -g @expo/ngrok
- tired yarn and it did not work
run app
yarn start --tunnel
Tunnel API
install ngrok
brew install ngrok
config / register
get add-auth token from https://dashboard.ngrok.com/get-started/setup/macos or where ever you get it from the website
add token to terminal
ngrok config add-authtoken [token]
run API
create ephemeral tunnel
ngrok http http://localhost:3000create named tunnel from terminal run:
ngrok http http://localhost:3000 --name [name]- example output includes
Forwarding https://b9d5ab4e28ce.ngrok-free.app -> http://localhost:3000 - I use the "https://b9d5ab4e28ce.ngrok-free.app" in my react native app fetch requests to the API running on my workstation.
- example output includes
Maybe OBE
Expo Go Publish to Google Play Store
video YouTube video
eas build --platform android- after build go to eas.dev project page and download the app
Expo Build
- How do I know I'm using Expo Build (or in development build mode): this is evident when you start the app with
yarn startyou get a message› Using development buildjust below the qr code - How do I know I'm using Expo Go:when using Expo Go you see the message
› Using Expo Go - once a project is in Expo build you can go back to Expo go by:
yarn remove expo-dev-clientyarn installYou'll need to remove all the build associated packages
Expo eas build
To run the build on the iPhone (or any Apple device), you must both:
- register with apple (https://developer.apple.com/account/resources/devices/list)
- let expo know the device is registered with apple via
eas device:create
for step 2 you will need the UDID
for UIDID:
- connect phone to computer
- click on iPhone in finder
- Click on the Serial Number field — it will change into the UDID.
- Right-click or copy it.
Google Sign in (recap)
This is my best guess as to what worked
1. eas build
- the command from the tutorial was
eas build --profile development --platform all - this takes 40mins to 2 hours maybe - do it in the early morning
build for ios
- in terminal
eas build --platform ios - ChatGPT says I can do this from a different terminal and work on the project in the meantime
- do not change git branches
Google Sign in [ First Try]
source video used: https://www.youtube.com/watch?v=tacJUeBYPYc&t=320s
1. npx expo prebuild
This will get the package names for ios and android
2. eas build
- the command from the tutorial was
eas build --profile development --platform all - when its done till will ask if you want to run and install on both android and ios
3. generate OAuth client
- got to https://console.cloud.google.com/auth
- create a new project > from "Overview" > "Get Started" > answer questions
- Create iOS client: Go to clients > select "iOS"
- use bundle id for example "com.costarica.kybervisionmobile11" is for KyberVisionMobile11
- this is also found in the app.json file or given while making the
eas build
- Create web client: Go to clients > select "Web application"
- just hit create no information needed to be given here
- Create Android client: Go to clients > select "Android"
- enter the package name is the same as bundle id
- enter the SHA1. I found this in expo.dev > Project > Configuration > Credentials > in a table called "Android upload keystore"
- or the video said use
eas credentialsfrom inside project folder
4. Modify app.json
"plugins": [
"expo-video",
[
"@react-native-google-signin/google-signin",
{
"iosUrlScheme": "com.googleusercontent.apps.493523572741-_SOME_CODE_"
}
]
],
5. Modify App.js
import { GoogleSignin } from "@react-native-google-signin/google-signin";
export default function App() {
useEffect(() => {
GoogleSignin.configure({
iosClientId:
"493523572741-_SOME_CODE_.apps.googleusercontent.com",
webClientId:
"493523572741-_SOME_CODE_.apps.googleusercontent.com",
profileImageSize: 150,
});
}, []);
return ();
}
6. Run app on emulator
- I did this first:
npx expo start - then:
yarn start worked
some key questions
- generate a new android keystore? (y/n)
- I did yes
- chatGPT explaination: It’s asking whether you want Expo to create this keystore file for you automatically — or if you already have one that you want to provide manually.
- This is your first time building this app for Android, or
- You don't already have an existing keystore, or
- You're not planning to migrate an existing Android app,
- Generate a new Apple Provisioning Profile?
- I did yes
- chatGPT explaination: It’s asking whether you want Expo to create this provisioning profile for you automatically — or if you already have one that you want to provide manually.
- this is taking some time to finish (> 20 mins so far)
3. generate OAuth client
- got to https://console.cloud.google.com/auth
- create a new project > from "Overview" > "Get Started" > answer questions
- Create iOS client: Go to clients > select "iOS"
- use bundle id for example "com.costarica.kybervisionmobile11" is for KyberVisionMobile11
- this is also found in the app.json file or given while making the
eas build
- Create web client: Go to clients > select "Web application"
- just hit create no information needed to be given here
- Create Android client: Go to clients > select "Android"
- enter the package name is the same as bundle id
- enter the SHA1. I found this in expo.dev > Project > Configuration > Credentials > in a table called "Android upload keystore"
- or the video said use
eas credentialsfrom inside project folder
4. install pacakge
yarn add @react-native-google-signin/google-signin@latest
- documentation: https://react-native-google-signin.github.io/docs/original
- responeses documentation: https://react-native-google-signin.github.io/docs/api
trouble shooting
error: TurboModuleRegistry.getEnforcing(...): 'RNGoogleSignin' could not be found. Verify that a module by this name is registered in the native binary.
eas build --profile development --platform all
I actually needed to do eas build --platform ios --profile development --local for emulator
Run expo build
npx expo start