【问题标题】:Could not resolve all artifacts for configuration ':pushwoosh-react-native-plugin:classpath'无法解析配置“:pushwoosh-react-native-plugin:classpath”的所有工件
【发布时间】:2019-09-25 19:21:21
【问题描述】:

我正在尝试将 Pushwoosh 安装到我的 React Native 应用程序中,但出现以下错误:

     > Could not resolve com.android.tools.build:gradle:2.3.3.
         > Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom'.
            > Could not GET 'https://maven.google.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom'.
               > maven.google.com: nodename nor servname provided, or not known
   > Could not resolve com.google.gms:google-services:4.2.0.
     Required by:
         project :pushwoosh-react-native-plugin
      > Could not resolve com.google.gms:google-services:4.2.0.
         > Could not get resource 'https://jcenter.bintray.com/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom'.
               > jcenter.bintray.com

我对 React Native 和 Android 开发还很陌生 - 所以我不太确定这里发生了什么。

我的主要 build.gradle 文件如下所示:

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.4.1")

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

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()

    }
}

我按照 github 上的说明进行操作。

谁能给我解释一下这里到底是什么问题?

【问题讨论】:

    标签: java android react-native gradle


    【解决方案1】:

    不确定这是否有帮助,但我从 jitpack 收到了同样的错误(在没有对项目进行相关更改后突然出现)。

    我要做的是将项目级别的 build.gradle 从 maven { url "https://jitpack.io" } 更改为 { url "https://www.jitpack.io" }

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-05-11
      • 1970-01-01
      • 2022-07-09
      • 1970-01-01
      • 1970-01-01
      • 2020-09-03
      • 1970-01-01
      相关资源
      最近更新 更多