How do I create an app bundle to publish app on Google Play Store? - react-native

I have created a react native app for the first time. To publish the app, I have to create an app bundle(.aab).
How do I create an app bundle?

This is what you do to generate an AAB bundle file.
cd android
./gradlew bundleRelease
Look at this for pre-requisites. To extract an APK out of the bundle and test it on a device before upload then use the bundletool from Google.

Related

can we create apk file from expo code or can we deploy our apk which is build in expo

Can we create APK file from expo code or can we deploy our APK which is build in expo. means can we create and deploy our APK file to Play Store and App Store without ejecting expo.
Yes, we can upload expo apps to the app store or play store.
Check out the official docs to upload the expo app:
https://docs.expo.io/distribution/uploading-apps/

Why I have this problem with the appbundle?

I published this app on the playstore (https://play.google.com/store/apps/details?id=com.brawlcalculator) and I want to reduce the dimension of the app using an app bundle. I created the app with React Native and I used in the same project this command to create the apk(./gradlew clean && ./gradlew assembleRelease) and I successfull published it into the playstore, then I created the app bundle with this command (./gradlew bundleDebug) and when I tried to upload the appbundle it gives me an error: "The appbundle have the wrong key". Does I have to upload the apk and the appbundle together?
assembleRelease signs the APK with your release key, while bundleDebug signs the Bundle with your debug key.
Instead, you should upload the Bundle built with your release key, which you can do using the bundleRelease task.

How to generate signed apk and deploy to google play store

i am using create-react-native-app
there is no android / iOS folder
how to generate signed apk and deploye to google play store
Here are the instructions for create-react-native-app app deployment.
https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md#sharing-and-deployment
If you want to build and deploy your app yourself, you'll need to eject from CRNA and use Xcode and Android Studio.
This is usually as simple as running npm run eject in your project, which will walk you through the process. Make sure to install react-native-cli and follow the native code getting started guide for React Native.
Generating key
https://facebook.github.io/react-native/docs/signed-apk-android.html
If you don't see android/ios folders in your directory. Then type in your terminal react-native upgrade then react-native link

React Native Expo publish to Android

I built a test application using react native. I'm trying to publish it following this tutorial: https://facebook.github.io/react-native/docs/signed-apk-android.html
However, my project does not have folder android. How can I create this folder?
In React-native, there are two method to create Singed APK File
First you should know
it's best to create apps using react-native init rather than expo as React-Native-Cli gives you local project for both ios and android,you can test and debug the code locally and also use the tool to publish applications
- If you create the project by using this command -
react-native init Project_Name
Then follow this method.
BUT IN YOUR CASE
you're using expo and also expo-cli! that's good! but when i use expo i usually like to go with expo XDE which has single version to publish,render or debug with it's own console in the bottom and that'll help you upload your code to expo server where you can ask them to render app for iOS or android and they will return you a link which will download the APK or the ipa file for android or iOS respectively
Here is the documentation link which'll explain you each step one by one and do keep an eye on the notes and TODOs while following the step (in your scenario)
- If you use expo,for create React-native project
then follow this method generate the singed APK file for Android - Expo

how to run react native code from server? i want to release app in android and apple store

I am an android developer and learning react native.
I made an app in React Native and now I want to release my app in android play store and apple store but I don't know where do I put my react native project code/files?
I had put react native code in my PHP(Linux) server but it's not working, it says file not found 404.
please guide, Thanks
You need to generate build standalone signed apk.
Generating Signed APK
https://facebook.github.io/react-native/docs/signed-apk-android.html
1) first create keystore file and put in android folder location
2) setting up gradle for keystore
3) run comman
react-native run-android --variant=release
after success run command you will file apk-release.apk in andorid/app/build/outputs/apk/ location
then you can uplaod apk to app store
If your app doesn't need detach (for example doesn't use bluetooth) you can use create-react-native-app and put your app code inside new project. That way you can publish your app to https://expo.io/ . It's a great way to publish your app without Google Play and App Store.
Here is instruction for creating new react native app with expo kit:
https://facebook.github.io/react-native/docs/getting-started.html
And here is how to publish it into expo:
https://docs.expo.io/versions/v25.0.0/guides/publishing.html#how-to-publish
All you need is create-react-native-app and exp command line tools.