Android Gradle 构建错误 - 配置“:classpath”的工件
Android Gradle build error - artifacts for configuration ':classpath'
当 运行 命令 tns run android
或 tns 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'
}
...
bintray 在其网络上存在下载问题 https://status.bintray.com/
我已经通过更改 app.gradle
中的很多东西解决了这个问题
我添加了 mavenCentral()
并将版本号从 3.3.0
classpath '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'
}
}
当 运行 命令 tns run android
或 tns 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'
}
...
bintray 在其网络上存在下载问题 https://status.bintray.com/
我已经通过更改 app.gradle
中的很多东西解决了这个问题
我添加了 mavenCentral()
并将版本号从 3.3.0
classpath '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'
}
}