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

后端 未结 7 2110
再見小時候
再見小時候 2021-02-19 22:36

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

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configu
7条回答
  •  野的像风
    2021-02-19 23:16

    buildscript {
        repositories {
            google() // I had to put this before jcenter(). If I put jcenter() first it fails when running react-native run-android
            jcenter()
        }
    }
    

    To be clear though, if i put jcenter() first in buildscript, I could still get a successful build within Android Studio. Running react-native run-android however was failing until I put google() in front of jcenter(). After that everything was smooth as butter.

提交回复
热议问题