Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not resolve all artifacts for configuration 'classpath' #23553

Closed
SuperCup opened this issue Oct 26, 2018 · 41 comments
Closed

Could not resolve all artifacts for configuration 'classpath' #23553

SuperCup opened this issue Oct 26, 2018 · 41 comments

Comments

@SuperCup
Copy link

SuperCup commented Oct 26, 2018

From URL: https://www.flutterchina.club/support.md

Finished with error: Please review your Gradle project setup in the android/ folder.
* Error running Gradle:
ProcessException: Process "/Users/../Desktop/flutter_app/android/gradlew" exited abnormally:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/../Desktop/flutter_app/android/app/build.gradle' line: 25

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all artifacts for configuration 'classpath'.
   > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
  Command: /Users/../Desktop/flutter_app/android/gradlew app:properties`

I have already done:

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}
@jsakars
Copy link

jsakars commented Oct 26, 2018

Same here. This is fixed in master but not under stable release yet. For now, I would suggest switching to master branch and wait for the fix to be released.

#23095

Here is the commit - 125b5d6

@zoechi
Copy link
Contributor

zoechi commented Oct 27, 2018

Merging with #23404

@zoechi zoechi closed this as completed Oct 27, 2018
@sumation
Copy link

sumation commented Nov 1, 2018

same issue

@Parth1029
Copy link

Parth1029 commented Nov 2, 2018

I solved the problem by moving :

maven {
    url 'https://dl.google.com/dl/android/maven2'
}

in the top of:

jcenter()

in the file: .flutter/packages/flutter_tools/gradle/flutter.gradle :

    buildscript {
    repositories {
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

@sumation
Copy link

sumation commented Nov 2, 2018

same issue
Solved by adding "google()" to gradle

@songyiYu
Copy link
Contributor

songyiYu commented Nov 2, 2018

@Parth1029 It is solved! Thank you 👍

@Sly777
Copy link

Sly777 commented Nov 2, 2018

@Parth1029 thanks it works on my app as well!

@rravithejareddy
Copy link

rravithejareddy commented Nov 3, 2018

still i am facing the issue.

@xring
Copy link

xring commented Nov 5, 2018

@ Parth1029 Great work! Thx.

@rravithejareddy
Copy link

rravithejareddy commented Nov 5, 2018

@Parth1029 still i am facing the issue, i tried to adding google(), but still i am getting same issue.

@marianoarga
Copy link

Upgrading Flutter should fix it @rravithejareddy

@rravithejareddy
Copy link

rravithejareddy commented Nov 13, 2018

Fixed by adding google() in flutter.gradle. Thanks.

@yefeidd
Copy link

yefeidd commented Nov 23, 2018

I solved the problem.
File->setting->build->Gradle->Android studio
checked "Enable embedded Maven repository".

@ethanyou725
Copy link

ethanyou725 commented Dec 16, 2018

gradle.properties set proxy 
org.gradle.jvmargs=-Xmx1536M
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=yourport
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=yourport

@TakeEasyBoy
Copy link

TakeEasyBoy commented Dec 17, 2018

I solved the problem.In android folder,edit build.gradle file like this:

buildscript {
    repositories {
        google()
        mavenCentral()  //add this line
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

It works.
stackoverflow link

@alitavanaali
Copy link

alitavanaali commented Jan 21, 2019

I had the same problem :

Could not resolve all artifacts for configuration ':classpath'.
Could not find builder.jar (com.android.tools.build:builder:3.0.1)
...... (62 error line)

The problem occurred when I was trying to add a package to my pubspec.yaml (audioplayers) so if you have the same problem, in Android Studio, at the left side (Project View (alt +1) navigate to:
External Libraries > Flutter Plugins > audioplayer (you should go to your plugin) > android > build.gradle
and change classpath 'com.android.tools.build:gradle:OLD VERSION' to YOUR VERSION. For example that was 3.0.1 which I needed 3.3.0

@prabh08
Copy link

prabh08 commented May 28, 2019

I have made all the possible changes but still I am facing this issue. Please help me. Here is I am getting while performing tns run

A problem occurred configuring root project 'newAppo'.

Could not resolve all artifacts for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:3.4.1.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.4.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.android.tools.build:gradle:3.4.1.
> Could not get resource 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.android.tools.build:gradle:3.4.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

@Benklins
Copy link

Benklins commented Jun 1, 2019

pls same issue.

error message below:
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':GkuonTestApplicationApp'.

Could not resolve all artifacts for configuration ':GkuonTestApplicationApp:classpath'.
Could not download robovm-dist-compiler.jar (com.gluonhq:robovm-dist-compiler:2.3.1-ios11)
> Could not get resource 'https://jcenter.bintray.com/com/gluonhq/robovm-dist-compiler/2.3.1-ios11/robovm-dist-compiler-2.3.1-ios11.jar'.
> Read timed out
Could not download ecj.jar (org.eclipse.jdt.core.compiler:ecj:4.4)
> Could not get resource 'https://jcenter.bintray.com/org/eclipse/jdt/core/compiler/ecj/4.4/ecj-4.4.jar'.
> Read timed out

@jonathar2605
Copy link

Hi, I have this problem when I try to execute a Serenity BDD project, I need to run from command line a gradle execution but generate that problem.

$ gradle clean test aggregate

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'IVR'.

Could not resolve all artifacts for configuration ':classpath'.
Could not resolve net.serenity-bdd:serenity-gradle-plugin:2.0.49.
Required by:
project :
> Could not resolve net.serenity-bdd:serenity-gradle-plugin:2.0.49.
> Could not get resource 'https://jcenter.bintray.com/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
> Could not HEAD 'https://jcenter.bintray.com/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/35.161.196.51, jcenter.bintray.com/54.148.18.233] failed: Connection timed out: connect
> Could not resolve net.serenity-bdd:serenity-gradle-plugin:2.0.49.
> Could not get resource 'https://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
> Could not HEAD 'https://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.4.215] failed: Connection timed out: connect
> Could not resolve net.serenity-bdd:serenity-gradle-plugin:2.0.49.
> Could not get resource 'http://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
> Could not HEAD 'http://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
> Connect to repo.maven.apache.org:80 [repo.maven.apache.org/151.101.4.215] failed: Connection timed out: connect
> Could not resolve net.serenity-bdd:serenity-gradle-plugin:2.0.49.
> Could not get resource 'https://plugins.gradle.org/m2/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
> Could not HEAD 'https://plugins.gradle.org/m2/net/serenity-bdd/serenity-gradle-plugin/2.0.49/serenity-gradle-plugin-2.0.49.pom'.
> Connect to plugins.gradle.org:443 [plugins.gradle.org/104.18.191.9, plugins.gradle.org/104.18.190.9] failed: Connection timed out: connect
Could not resolve net.serenity-bdd:serenity-emailer:2.0.49.
Required by:
project :
> Could not resolve net.serenity-bdd:serenity-emailer:2.0.49.
> Could not get resource 'https://jcenter.bintray.com/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
> Could not HEAD 'https://jcenter.bintray.com/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/35.161.196.51, jcenter.bintray.com/54.148.18.233] failed: Connection timed out: connect
> Could not resolve net.serenity-bdd:serenity-emailer:2.0.49.
> Could not get resource 'https://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
> Could not HEAD 'https://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.4.215] failed: Connection timed out: connect
> Could not resolve net.serenity-bdd:serenity-emailer:2.0.49.
> Could not get resource 'http://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
> Could not HEAD 'http://repo.maven.apache.org/maven2/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
> Connect to repo.maven.apache.org:80 [repo.maven.apache.org/151.101.4.215] failed: Connection timed out: connect
> Could not resolve net.serenity-bdd:serenity-emailer:2.0.49.
> Could not get resource 'https://plugins.gradle.org/m2/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
> Could not HEAD 'https://plugins.gradle.org/m2/net/serenity-bdd/serenity-emailer/2.0.49/serenity-emailer-2.0.49.pom'.
> Connect to plugins.gradle.org:443 [plugins.gradle.org/104.18.191.9, plugins.gradle.org/104.18.190.9] failed: Connection timed out: connect

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 6m 31s
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:"C:\Program Files (x86)\Micro Focus\Unified Functional Testing\bin\java_shared\classes\jasmine.jar"

And this is my build.gradle

buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven {url = 'http://repo.maven.apache.org/maven2'}
}

dependencies {
	classpath "net.serenity-bdd:serenity-gradle-plugin:2.0.49"
	classpath "net.serenity-bdd:serenity-emailer:2.0.49"
	
}	

}

plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
}

repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenLocal()
jcenter()
}

apply plugin: 'net.serenity-bdd.aggregator'
apply plugin: 'java'
apply plugin: 'eclipse'

defaultTasks = ['clean', 'build']

tasks.withType(Test) {
reports.html.destination = new File('IVR', name)
println(it.name + '\t' + reports.html.destination)
scanForTestClasses = false
include "**/*Runner.class" // whatever Ant pattern matches your test class files
}

dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'

// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:26.0-jre'

// Use JUnit test framework
testImplementation 'junit:junit:4.12'    


compile group: 'org.apache.poi', name: 'poi-ooxml-schemas', version: '4.1.0'    
compile group: 'org.apache.poi', name: 'poi-ooxml', version: '4.1.0'
compile group: 'org.apache.poi', name: 'poi', version: '4.1.0'
compile group: 'net.serenity-bdd', name: 'serenity-reports', version: '2.0.49'
compile group: 'net.serenity-bdd', name: 'serenity-model', version: '2.0.49'
compile group: 'net.serenity-bdd', name: 'serenity-junit', version: '2.0.49'
compile group: 'net.serenity-bdd', name: 'serenity-core', version: '2.0.49'
compile group: 'net.serenity-bdd', name: 'serenity-cucumber', version: '1.9.31'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.8.0-beta4'    
testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.8.0-beta4'


compile group: 'net.serenity-bdd', name: 'serenity-gradle-plugin', version: '1.9.36'
compile group: 'net.serenity-bdd', name: 'serenity-emailer', version: '1.9.36'

}

serenity {
reports = ["email"]
}

test.finalizedBy(aggregate)

Please help me, with this problem

@Paulswith
Copy link

I run it on vs code and throws the same problem. like below:

* Get more help at https://help.gradle.org

BUILD FAILED in 30s
  Command: /Users/dobby/Dropbox/Code/Android/VSFlutter/hello_flutter/android/gradlew app:properties

Open terminal goes to /path/to/your/app/android, run above command with proxy configs, and it resolved.

./gradlew app:properties -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=1087 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=1087 --debug

image

@irvingreece
Copy link

TakeEasyBoy's suggestion worked for me. Thanks.

@PocoMin
Copy link

PocoMin commented Oct 24, 2019

Go to cordova-support-google-services/app-build.gradle, replace maventCentral() with
maven { url "https://maven.google.com" }
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap'}

Credits to hunijkah in https://stackoverflow.com/questions/58529904/error-could-not-find-org-jetbrains-kotlinkotlin-stdlib-jdk81-3-60-eap-25-in-i

@gayanramyakumara
Copy link

Got the same issue.anyone can help me..please.

Screen Shot 2019-10-26 at 11 56 15 PM

@Suppppppp
Copy link

I did everything that written this page but it doesn't work.
Last, I tried to update so it worked.
If you tried all the way but when it doesn't work, try update flutter

@yibingxiong
Copy link

@TakeEasyBoy not work. I'm dying

@yibingxiong
Copy link

@Parth1029 not work. I'm dying really.

@yibingxiong
Copy link

@Suppppppp I updated flutter 1.9.1+hotfix.6 , but it doesn't work also. what your flutter version.

Flutter 1.9.1+hotfix.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 68587a0916 (7 weeks ago) • 2019-09-13 19:46:58 -0700
Engine • revision b863200c37
Tools • Dart 2.5.0

@aboutmydreams
Copy link

not work. I'm dying really too

@flutteradv
Copy link

I faced this error after upgrading to Flutter 1.12.13+hotfix.5 :

Could not resolve all artifacts for configuration ':app:debugCompileClasspath'.
  > Could not download flutter_embedding_debug.jar (io.flutter:flutter_embedding_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695)
     > Could not get resource 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.jar'.

@onemanstartup
Copy link

@flutteradv Update flutter, Accept android licences flutter doctor --android-licenses, run flutter clean

@flutteradv
Copy link

flutteradv commented Dec 19, 2019

I ended up reverting back to flutter 1.9.1

@shaileshpanthee
Copy link

shaileshpanthee commented Dec 31, 2019

I solved the problem by moving :

maven {
    url 'https://dl.google.com/dl/android/maven2'
}

in the top of:

jcenter()

in the file: .flutter/packages/flutter_tools/gradle/flutter.gradle :

    buildscript {
    repositories {
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

I couldn't find the file .flutter. Where is the .flutter dir located?

@coderoid-omega
Copy link

I solved the problem.In android folder,edit build.gradle file like this:

buildscript {
    repositories {
        google()
        mavenCentral()  //add this line
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

It works.
stackoverflow link

It Worked!

@coderoid-omega
Copy link

I solved the problem by moving :

maven {
    url 'https://dl.google.com/dl/android/maven2'
}

in the top of:

jcenter()

in the file: .flutter/packages/flutter_tools/gradle/flutter.gradle :

    buildscript {
    repositories {
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

I couldn't find the file .flutter. Where is the .flutter dir located?

.flutter is just a convention, here '.flutter' is the path where you extracted or installed flutter in your system. Hope this helps you.

@Niek-Okido
Copy link

Niek-Okido commented Feb 6, 2020

edit the following in build.gradle :

    repositories {
        jcenter()
        mavenCentral() #add
        google() #add
    }
    ....
}

@succygoldbaji
Copy link

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath'.

i Dont know why am getting this error......

THIS IS MY build.gradle
pls i dont know what to do

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
    google()
    jcenter()
    
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.6.1'
    

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
google()
jcenter()

}

}

task clean(type: Delete) {
delete rootProject.buildDir
}

@derekgithubs
Copy link

I solved it by....

  • go to search icon on the top-right corner and search for "Execute Gradle Task".
  • click on result "Execute Gradle Task" after it appear , And you'll be given sort of options.
    NOTE: Now make sure you have internet.
  • double click on "gradle mergeDexRelease" among the other options.
    .....Now wait for it to finish download some stuffs, then you are good......

It worked for me, i'm using Windows...

@nhhockeyplayer
Copy link

this is outrageous
the whole subsystem, surrounding gradle needs to be torn out honked and redesigned and replaced
I have never seen such lengthy issues on incomplete gradle mechanisms
and they still havent gotten it right
i spent days/weeks June 2019 on same gradle wrapper transient dependencies omissions and now its impact8in my development schedule again

WHEN WILL THEY FINALLY DESIGN SOMETHING THATS CONFIGURABLE FROM THE ROOT FILE CONFIG.XML AND BE DONE WITH IT... environment variables anyone ?

I know if Im going to shoot my mouth off I should do it myself

well its simple

a root environment variable that trickles down thru the whole archetype

DONE

and maybe a flag for caching to prevent tangled repo jars

@Sylvester-dev
Copy link

@gayanramyakumara I am also facing same issue can i know how you solved this issue.

@nhhockeyplayer
Copy link

nhhockeyplayer commented Apr 8, 2020

i went with capacitor
instead of treating the android like a build artifact it treats it as a source artifact
completely configurable

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests