1

I'm trying to run react-native run-android on a (kinda old) project of a friend. I'm getting this error:

Could not find com.android.tools.build:gradle:3.0.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
         https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
     Required by:
         project :

I tried to enter the links, and they are returning a 404 error. Are this links placed in a configuration file? Where do I get valid links for those files? Which file to modify to get said files?

Mikael Brenner
  • 357
  • 1
  • 7
  • Try to find in outher repository – Jhonatan S. Souza Feb 16 '18 at 18:20
  • Please refer: - https://stackoverflow.com/questions/45188703/could-not-find-com-android-tools-build-gradle3-0-0-alpha7/45188917 - https://stackoverflow.com/questions/47515676/gradle-4-1-issue-on-latest-android-studio-3-0-1 – Aseem Feb 16 '18 at 18:23

1 Answers1

1

The problem was solved by adding the google() to the repositories, on the android/app/build.gradle file. Final result looks like

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        google()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}
Mikael Brenner
  • 357
  • 1
  • 7