java - 无法解析配置 ':pushwoosh-react-native-plugin:classpath' 的所有 Artifact

标签 java android react-native gradle

我正在尝试将 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 开发相当陌生 - 所以我不太确定这里发生了什么。

我的主 bu​​ild.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 上的说明进行操作。

有人可以向我解释一下这里到底是什么问题吗?

最佳答案

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

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

关于java - 无法解析配置 ':pushwoosh-react-native-plugin:classpath' 的所有 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58105246/

相关文章:

java - 如何配置 JComboBox 在创建时不选择第一个元素?

javascript - 如何使用 window.crypto.getRandomValues 获取特定范围内的随机值

java - 为什么我无法在 eclipse 中打开 android list 类?

android - react native : Dev Server IP iOS vs Android

react-native - 当我在 React Native 中导航到新页面时,如何强制卸载组件?

java - 如何在 Java 中将 int[] 转换为 Integer[]?

java - 如何提高android中输入命令的速度?

java - Android Studio 1.2.2 - junit - json 为空,为什么?

android - 我可以为 list 文件包提供动态占位符吗?

ios - 在 Xcode 存档期间找不到 libCodePush.a