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'
}
...
Compile classpath – this is a list of dependencies that are required for the JDK to be able to compile Java code into . class files. Runtime classpath – this list of dependencies is required to actually run the compiled Java code.
This is because of slow internet connection or you haven't configure proxy settings correctly. Gradle needs to download some dependencies , if it cant access the repository it fires this error. All you have to do is check your internet connection and make sure gradle can access the maven repository. Save this answer.
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'
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With