ERROR: autolinkLibrariesFromCommand: process cmd /c npx @react-native-community/cli config exited with error code: 1
FAILURE: Build failed with an exception.
* Where:
Settings file 'C:Usersasif1Desktopbaseandroidsettings.gradle' line: 3
* What went wrong:
A problem occurred evaluating settings 'android'.
> ERROR: autolinkLibrariesFromCommand: process cmd /c npx @react-native-community/cli config exited with error code: 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org
BUILD FAILED in 9s.
info Run CLI with --verbose flag for more details
First, when I create the minimal project using below command:
npx @react-native-community/cli@latest init AwesomeProject
Then I hit commmand either npm start
or npx react-native run-android
.
First time it works absolutely fine, once I add package like react navigation and I try to restart the server, i get the above build failed error
ERROR: autolinkLibrariesFromCommand
Asif Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
I would ensure the packages are in good condition by deleting the project cache through removing node_modules
and lock files. Then I’d run npm install
(or yarn install
). Also, make sure you’re using the latest React Native release.
npm install -g @react-native-community/cli@latest
Moreover, you may also need to clean your Gradle in the android
folder.