React Native FAILURE: Build failed with an exception. Could not resolve ':classpath'. Could not find com.android.tools.build:gradle:3.0.1

Viewed 13770

When I make the command "react-native run-android" then it happened:

FAILURE: Build failed with an exception.

screenshot:

enter image description here

7 Answers

Jcenter does not have Gradle 3.0.1.

Gradle 3.0.1

It is available in Google's maven repository. here

You should add google() to allprojects in your project level build.gradle

Do this:

In your react native project, Navigate to -> android -> build.gradle.

add google() to allproject repository like this:

enter image description here

This should fix your problem.

Edit 1: replace google() with this

maven {
            url "https://maven.google.com/"
}  

try changing the class path in your build.gradle file from

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

to

    classpath 'com.android.tools.build:gradle:3.0.1'
Related