Upon typing the command "expo credentials:manager -p android" in terminal, I get:
'expo credentials:manager is not supported in the local CLI, please use eas credentials instead'
However, I know i recently uninstalled EAS so I cannot use eas credentials.
Is there any way to still use expo credentials:manager -p android? Also, why is it not supported?
I created an empty project and uploaded it using EAS build for android. "eas build -p android". but the app.aab file has 30.9MB. An empty native project in kotlin/java has something about 5-7MB. How can I reduce this EAS app bundle?
expo build:android -t app-bundle works for me
I am generating APK using eas build --platform android and expo build:android -t apk.
Both generate apps but the eas build generated app crashes while the expo build app works fine. There is no difference in code. Not able to check why it happens. Any suggestion would be helpful.
I resolved the issue by manually installing some dependency that EXPO is managing itself.
Building .apks using EXPO command expo build:android -t apk never crashed on the physical device, but when I switched to EAS command eas build --platform android the app crashed on physical devices.
Dependency e.g "react-native-screens": "~3.8.0". Now i can export .apk and .aab using EAS command eas build --platform android
Other issues like camera and gallery permission are also managed by EXPO if you don't mention them.
This may be because of the Expo SDK version.
enter image description here
Why do you want the new Build React Native Can't Compressing Project Files?
What is wrong ?
Is the EAS EXPO still the development stage?
if you use it
Expo Build: Android -t APK
Expo Build: Android -t App-Bundle
can be good but if you use it
EAS Build - Android Platform
EAS Build - Platform iOS
EAS Build -P Android - Prevrofile Preview
can't,
why ?
I've seen new release of react native for android and tried some examples. It works only with USB debug mode and "adb reverse tcp:8081 tcp:8081". How can I build android app for "production" including all dependencies and without react web-server connections.
Thank you.
To build a release version of your Android app:
$ cd your-app-folder
$ cd android && ./gradlew assembleRelease
You'll need to set up signing keys for the Play Store, full documentation here: https://reactnative.dev/docs/signed-apk-android
You will have to create a key to sign the apk. Use below to create your key:
keytool -genkey -v -keystore my-app-key.keystore -alias my-app-alias -keyalg RSA -keysize 2048 -validity 10000
Use a password when prompted
Once the key is generated, use it to generate the installable build:
react-native bundle --platform android --dev false --entry-file index.android.js \
--bundle-output android/app/src/main/assets/index.android.bundle \
--assets-dest android/app/src/main/res/
Generate the build using gradle
cd android && ./gradlew assembleRelease
Upload the APK to your phone. The -r flag will replace the existing app (if it exists)
adb install -r ./app/build/outputs/apk/app-release-unsigned.apk
A more detailed description is mentioned here: https://facebook.github.io/react-native/docs/signed-apk-android.html
As for me, I add in my package.json to "scripts":
"release": "cd android && ./gradlew assembleRelease"
And then in terminal I use:
npm run release
Or with yarn:
yarn release
I have put together some steps that worked for me. Hopefully it would save time.
For bundling the package to work in local you need to do
$ curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
Then for compiling apk
$ ./gradlew assembleRelease
I have added detailed instructions at : https://github.com/shyjal/reactnative-android-production
To create a bundle of your android application to release application on play store.
cd /android
sudo ./gradlew bundleRelease
go to the android/build/outputs/bundle/release/app-release.apk
Upload this bundle on play store console.