Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find com.android.tools.build:gradle:6.4.1

I faced the problem, more correct in gradle, when I enter the command - npx react-native run-android into the console - it gives me the following error :

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

What went wrong: A problem occurred configuring root project 'Da'.

Could not resolve all artifacts for configuration ':classpath'.

Could not find com.android.tools.build:gradle:6.4.1.

Searched in the following locations> https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/6.4.1/gradle-6.4.1.pom -https://jcenter.bintray.com/com/android/tools/build/gradle/6.4.1/gradle-6.4.1.pom

Initially - the problem was incompatibility between gradle and android versions, but after i changed version of gradle and terminal automatically download new version into directory, first error disappeared, but i got another (current problem). I had try some advice before asking question in StackOverFlow, but they didn't work. Here some characteristics : React-Native Doctor image

Gradle code : gradle.properties , gradle-wrapper.properties

Gradle Directory : Here

Path variables :Here

I appreciate all help (I think, that issue is in PATH, but not sure). By the way - does anyone know, how to add pictures without link?

like image 844
Tanatoz Avatar asked Apr 18 '26 04:04

Tanatoz


1 Answers

You are confusing gradle with the gradle plugin.

The gradle plugin 6.4.1 doesn't exist.

Use the latest stable version:

classpath 'com.android.tools.build:gradle:4.2.2'

Check also the compatibility with the gradle version:

Plugin version  Required Gradle version
4.0.0+          6.1.1+
4.1.0+          6.5+
4.2.0+          6.7.1+
like image 100
Gabriele Mariotti Avatar answered Apr 19 '26 17:04

Gabriele Mariotti



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!