【问题标题】:Android Gradle build error - artifacts for configuration ':classpath' [duplicate]Android Gradle构建错误-配置':classpath'的工件[重复]
【发布时间】:2019-08-12 04:16:06
【问题描述】:

运行命令tns run androidtns debug android 时出现以下错误。在我从C:\Users\yash\.gradle\gradle.properties 中删除.gradle/gradle.properties 文件夹之前它工作正常,现在我无法撤消它。

我得到的 50 个错误中有 1 个是:

Could not resolve all artifacts for configuration ':classpath'.
Could not resolve org.ow2.asm:asm:6.0.
     Required by:
         project : > com.android.tools.build:gradle:3.3.1
         project : > com.android.tools.build:gradle:3.3.1 > com.android.tools.build:builder:3.3.1
         project : > com.android.tools.build:gradle:3.3.1 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02

NS 版本

 "nativescript": {
    "id": "org.nativescript.chennaivolunteers",
    "tns-ios": {
      "version": "5.0.0"
    },
    "tns-android": {
      "version": "5.2.1"
    }
}

app.gradle

...

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
    }
}

android {
  defaultConfig {  
    generatedDensities = []
    applicationId = "org.nativescript.chennaivolunteers"  
  }  
  signingConfigs {
    config {
      // You need to specify either an absolute path or include the
      // keystore file in the same directory as the build.gradle file.
      storeFile file("<store-filename>.jks")
      storePassword "<store-password>"
      keyAlias "<store-alias>"
      keyPassword "<store-password>"
    }
  }
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }  
} 
project.ext {
    googlePlayServicesVersion = "+"
}
dependencies {
  compile 'com.facebook.android:facebook-android-sdk:4.6.0'
}
...

【问题讨论】:

  • @ישואוהבאותך 我已经尝试过上述问题中提到的解决方案,您可以在我的app.gradle 文件中看到
  • 我再次检查了重复的问题,发现最近的答案与您当前的答案相同。所以,我将结束这个问题。
  • @ישואוהבאותך 确定

标签: android gradle android-gradle-plugin nativescript


【解决方案1】:

我已通过更改我的 app.gradle 中的许多内容来解决此问题 我添加了mavenCentral()并将版本号从3.3.0classpath 'com.android.tools.build:gradle:3.3.1'更改为3.3.1

buildscript {
    repositories {
        mavenCentral()
        google()
        jcenter()
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
    }
}

【讨论】:

    【解决方案2】:

    bintray 是他们网络上的下载问题https://status.bintray.com/

    【讨论】:

      猜你喜欢
      • 2021-08-01
      • 1970-01-01
      • 2018-03-31
      • 2021-10-25
      • 2017-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多