Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React-Native Android Windows error: Could not find com.facebook.react:react-native-gradle-plugin:

We are currently working with React-Native 0.68.5, Windows 10 and are getting this error when trying to build the gradle file:

Could not resolve all task dependencies for configuration ':classpath'. > Could not find com.facebook.react:react-native-gradle-plugin:.

So far we have tried different versions of com.android.tools.build:gradle, as well as installing 'react-native-gradle-plugin' manually to package.json, also tried deleting the '.gradle' folder and rebuilding it but so far none have worked. Looking for insights from anyone who has faced this issue before and how you were able to resolve it (https://i.sstatic.net/5cKSj.png)

(https://i.sstatic.net/LEqmq.png)

(https://i.sstatic.net/nhPZX.png)

(https://i.sstatic.net/nK4Gl.png)

like image 457
stackdev33 Avatar asked Jan 20 '26 16:01

stackdev33


2 Answers

After you reinstall node_modules with updated package.json to support latest (0.71) react native, you need to edit your settings.gradle file by adding this line:

includeBuild('../node_modules/react-native-gradle-plugin')

Then go to Android folder. And clean the Android folder using ./gradlew clean command and run build, maybe this will help fix your issue.

like image 116
Prashoor Avatar answered Jan 23 '26 06:01

Prashoor


Simply deleting node_modules and runing npm install works for me

Steps in windows in the root of the project.

rmdir /s node_modules

npm install
like image 45
yaxx Avatar answered Jan 23 '26 06:01

yaxx



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!