无法解析配置“:react-native-vector-icons:classpath”的所有文件

Could not resolve all files for configuration ':react-native-vector-icons:classpath'

我在尝试 运行

时遇到以下错误
react-native run android

控制台控诉:

  • What went wrong:

A problem occurred configuring project ':react-native-vector-icons'.

> Could not resolve all files for configuration ':react-native-vector-icons:classpath'.

> Could not find any matches for com.android.tools.build:gradle:2.3.+ as no versions of com.android.tools.build:gradle are available.

Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml https://jcenter.bintray.com/com/android/tools/build/gradle/

Required by: project :react-native-vector-icons

改变 react-native-vector-icons 的版本就成功了

其实我在这个post中找到了答案:

通过在 package.json 文件中进行更改使其工作。

更改行:

"react-native-vector-icons": "^5.0.0",

收件人:

"react-native-vector-icons": "^6.1.0",

在这里查看:

尝试将其添加到您的 build.gradle 文件中。

subprojects {
    if (project.name.contains('react-native-vector-icons')) {
        buildscript {
            repositories {
                jcenter()
                maven { url "https://dl.bintray.com/android/android-tools/"  }
            }
        }
    }
}
  1. 尝试更新 react-native-vector-icons。
  2. 如果您不想更新,请将类路径版本更改为 2.2.3 而不是 2.3.+