React Native Android Studio 3.0.0にアップグレード後react-native run-android エラー

React Native Android Studio 3.0.0にアップグレードした後に

コマンドラインで、「react-native run-android」を実行する際に下記のエラーが出てきました!

com.android.tools.build:gradle:3.0.0」 が見つかりません。

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'myproject'.
> Could not resolve all files for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar
Required by:
project :

対策:

projectのbuild.gradleにて

buildscript {
    repositories {
        jcenter()
        google() <---ここを追加
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
    }
}

https://stackoverflow.com/questions/44071080/could-not-find-com-android-tools-buildgradle3-0-0-alpha1-in-circle-ci

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close