Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate Android app bundle in React Native?

I used the official documentation of React Native to build apk file. All other procedures worked fine but creating aab file is not working for me. I used the following command cd android && ./gradlew bundleRelease But it's not working on Windows. It is just giving me error of ". is not recognized"

like image 324
Faizan Khokhar Avatar asked Apr 14 '20 04:04

Faizan Khokhar


People also ask

How do I create an AAB file?

Generating an AAB in Android Studio To create an AAB binary locally using Android Studio, open the Build menu, then choose “Generate Signed Bundle / APK.” Follow the prompts to sign the AAB with your keystore file. For complete details, view the Android documentation.

What is bundle in react native?

Bundling. Most React apps will have their files “bundled” using tools like Webpack, Rollup or Browserify. Bundling is the process of following imported files and merging them into a single file: a “bundle”. This bundle can then be included on a webpage to load an entire app at once.

How to generate release APK for React Native android project?

Select APK to generate release APK for your React Native Android project. Then, Click on Next Select passwords for the keystore and key and rnter the certificate information. Thus, click on OK, then click on Next.

Do I need to create a bundle file for React Native components?

I’ve spent some time recently incorporating React Native components into our existing app. This comes with the extra requirement of release builds requiring the creation of the bundle file. I would have expected this to be a straightforward, well documented workflow, but was unfortunately a bit disappointed.

How to integrate React-Native with Android app?

Step 1: Go to the root of the project in the terminal and run the below command: react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res Step 1. Generate a keystore

How to create a react native executable binary for Android?

If everything compiles as expected you are good to go. Step 1. Generate a keystore You will need a Java generated signing key which is a keystore file used to generate a React Native executable binary for Android. You can create one using the keytool in the terminal with the following command


2 Answers

to create main js Bundle

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

and then run cd android && ./gradlew assembleRelease

like image 151
Neelam Soni Avatar answered Sep 21 '22 15:09

Neelam Soni


cd android/
./gradlew bundleRelease
like image 41
Mohamed Sallami Rehouma Avatar answered Sep 18 '22 15:09

Mohamed Sallami Rehouma