Android Gradle构建错误-配置':classpath'的工件 [英] Android Gradle build error - artifacts for configuration ':classpath'

查看:403
本文介绍了Android Gradle构建错误-配置':classpath'的工件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm getting the errors below, when running the command tns run android or tns debug android. Before it was working fine until I've deleted .gradle/gradle.properties folder from the C:\Users\yash\.gradle\gradle.properties and now I'm not able to UNDO it.

我遇到的50个错误中有1个是

There 1 of the 50 error I'm getting is:

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中的许多内容来解决此问题 我添加了mavenCentral(),并将版本号从3.3.0 classpath 'com.android.tools.build:gradle:3.3.1'更改为3.3.1.

I've fixed this issue by changing quite a few things in my app.gradle I have added mavenCentral() and changed the version number to 3.3.1 from 3.3.0 classpath 'com.android.tools.build:gradle: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'
    }
}

这篇关于Android Gradle构建错误-配置':classpath'的工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆