Reputation: 519
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"
Upvotes: 14
Views: 45733
Reputation: 201
First go to android folder
cd android/
and then run
./gradlew bundleRelease
more simple
cd android/ && ./gradlew bundleRelease
Upvotes: 16
Reputation: 1351
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
Upvotes: 31
Reputation: 28478
On Windows, you can use the gradlew executable made for Bash, unless you install WSL for Windows (which is highly recommended for many other reasons, so then your ./gradlew would just work in the WSL shell). Without WSL, you need to use the gradlew.bat
file instead, which should be in your android folder in your repo as its included in the react native starter files.
From then on, every command you see written with ./gradlew
should be replaced with it, e.g. gradlew.bat assembleRelease
. Be sure to be in the 'android' folder though.
Upvotes: 1
Reputation: 1568
Below command work perfectly in mac
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle && cd ./android && ./gradlew app:assembleRelease
Upvotes: 7