Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error Unrecognized command "build-android". Did you mean "run-android"?

According to the official React Native docs,

I am trying to generate a .aab file for release. When I run the command

npx react-native build-android --mode=release

I get this error

error Unrecognized command "build-android". Did you mean "run-android"?

like image 425
Matt Avatar asked Jul 22 '26 22:07

Matt


1 Answers

For react-native versions < 0.72. To generate .aab for release, you need to go to Android folder and run the following commands

.\gradlew clean

then

.\gradlew bundleRelease

According to this documentation

like image 143
Muhammad Ahmad Avatar answered Jul 24 '26 10:07

Muhammad Ahmad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!