make sure in app.json
{
"expo": {
"name": "your app name",
"description": "your app desc",
....,
"ios": {
"supportsTablet": true
},
"android": {
"package": "com.yourcompany.yourappname"
}
}
}
then run expo build:android or expo ba
after that
run expo build:status
you'll find, something like this, the Apk's is hosted on amazon aws
[exp] Android:
[exp] APK: https://HOST/yourapp.apk
Answer from Ansyori on Stack OverflowVideos
make sure in app.json
{
"expo": {
"name": "your app name",
"description": "your app desc",
....,
"ios": {
"supportsTablet": true
},
"android": {
"package": "com.yourcompany.yourappname"
}
}
}
then run expo build:android or expo ba
after that
run expo build:status
you'll find, something like this, the Apk's is hosted on amazon aws
[exp] Android:
[exp] APK: https://HOST/yourapp.apk
You will need to run expo build:status. When building process is complete you will see link to download apk (Android) or ipa(IOS) file.
I finally got it to work. The funny part is that I got the answer from the AI that is now banned here. But I just tested this solution on a real android device and it works. Anyway there are two changes needed:
REQUEST_INSTALL_PACKAGESmust be added toapp.jsonfile.- Uri for intent must be a content uri so:
localUri = await FileSystem.getContentUriAsync(localUri)
Maybe you can use this command to build release build.
expo:build android
For that you have to signup in Expo's website.
After that you can get apk in Expo's server.
As the title says
I’m new to react native.
I have an issue with my app where it works expo go but not working in apk and i have exhausted expo free tier. If there there is way to do that pls help
I want to build apk of my expo react native app but without using expo.dev Since they have a limit of 30 builds, and its very slow as well. Is there any way to build the apk locally? I ran the expo run:android command, it generated android folder, I tried to use android studio to build apk, but I got the development build instead.
I also tried editing eas.json, it gives the apk on their website itself, but is there any way to generate apk locally? Also it works in my one project, but in another project of mine, it doesn't work, I still get playstore build only.
Or how to effectively use the update command instead of making new apk everytime, because free account gets 10000 updates in a month, so that is suffice for me. But not able to figure out the update part.
Change production key in eas.json
to this
"production": {
"android": {
"buildType": "apk"
}
}
So now your eas.json
like this
{
"cli": {
"version": ">= 0.52.0"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal"
},
"production": {
"android": {
"buildType": "apk"
}
}
},
"submit": {
"production": {}
}
}
To build into .apk file, you can build using production profile. The command like this
eas build --profile production --platform android
Here is the detailed instruction: https://docs.expo.dev/build/eas-json/
You need to create eas.json in the project directory as:
{
"build": {
"preview": {
"android": {
"buildType": "apk"
}
},
"production": {}
},
"cli": {
"version": ">= 0.52.0"
}
}
Then use the following command:
eas build -p android --profile preview
Regards, Shameel
I use EAS as well and i find it quite handy. Let me explain the profiles quickly.
All profiles can be found in
eas.json
Development
This type is for developing, it makes it possible to see live reloads, live changes in the application when you change it. You can even pass env. variables if needed.
eas build --profile development --platform android
OR
To make a local build so the Expo Application Service is skipped
npx expo run:android
"development": {
"developmentClient": true,
"distribution": "internal",
"env": {
"API_URL": "X",
}
Preview
This creates a .apk file that you can install on your device or emulator. Note the the env. variable does not need to be the same as development
eas build --profile preview --platform android
"preview": {
"distribution": "internal",
"env": {
"API_URL": "Y",
}
},
Production
This creates a .aab file which you can upload on to Google Developer Console, if you want to set your app on the app store.
eas build --profile production --platform android
"production": {
"env": {
"API_URL": "X",
}
},
If you do not need the env values, you can safely delete them.
After executing on of the commands in your terminal, a link should appear to expo.dev where you can download and install your development or preview .apk file
I use the EAS to create development builds and generate apk file. Reference my eas configuration to see the different profiles setup. At minimal, I have development, development-simulator and production build profiles defined.
{
"cli": {
"appVersionSource": "local"
},
"build": {
"development": {
"distribution": "internal",
"channel": "uat",
"developmentClient": true,
"env": {
"bundleIdentifier": "",
"name": "",
"APP_VARIANT": "development"
},
"autoIncrement": false,
"android": {
"buildType": "apk",
"gradleCommand": ":app:assembleDebug"
}
},
"development-simulator": {
"extends": "development",
"ios": {
"simulator": true
}
},
"production": {
"channel": "production",
"distribution": "store",
"developmentClient": false,
"autoIncrement": false,
"env": {
"bundleIdentifier": "",
"name": ""
},
"ios": {
"resourceClass": "m1-medium"
}
},
"internal": {
"extends": "production",
"channel": "production",
"distribution": "internal",
"developmentClient": false,
"autoIncrement": false,
"env": {
"bundleIdentifier": "",
"name": ""
}
},
"uat": {
"extends": "production",
"channel": "uat",
"distribution": "internal",
"developmentClient": false,
"autoIncrement": false,
"env": {
"bundleIdentifier": "",
"name": ""
}
}
}
}
For example, to create a build for Android simulator, run
npm run build:android:dev
The build may take up to a few minutes to complete depending on the queue.
After the build is complete, you can download it on your iOS device by scanning the QR code from the device's camera from the Expo CLI. You can also find this QR code on the build page in the expo dashboard.
With the development build installed on your device or emulator/simulator, start the development server with npm run start. The app will run on your device and you can make changes in javascript and see the changes immediately.
A rebuild of the development client is only necessary if you add a library to your project that contains native code APIs, for example, expo-secure-store.