Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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'
}
...
like image 425
Yashwardhan Pauranik Avatar asked Mar 21 '19 10:03

Yashwardhan Pauranik


People also ask

What is compile classpath in Gradle?

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.

Can't resolve all files for configuration Gradle?

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.


1 Answers

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'
    }
}
like image 179
Yashwardhan Pauranik Avatar answered Oct 20 '22 04:10

Yashwardhan Pauranik