Android Gradle build error - artifacts for configuration ':classpath' [duplicate]

ぃ、小莉子 提交于 2019-12-10 14:35:55

问题


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.

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

Version of 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'
}
...

回答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'
    }
}



回答2:


bintray is download issues on their network https://status.bintray.com/



来源:https://stackoverflow.com/questions/55278227/android-gradle-build-error-artifacts-for-configuration-classpath

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!