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

1

7

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"?

Isometropia answered 3/7, 2023 at 19:23 Comment(0)
A
12

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

Antimacassar answered 4/7, 2023 at 7:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.