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 · 21 comments

Comments

@SuperCup
Copy link

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'
    }
}
@werdlv

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Oct 27, 2018

Merging with #23404

@zoechi zoechi closed this Oct 27, 2018

@sumation

This comment has been minimized.

Copy link

commented Nov 1, 2018

same issue

@Parth1029

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Nov 2, 2018

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

@songyiYu

This comment has been minimized.

Copy link

commented Nov 2, 2018

@Parth1029 It is solved! Thank you 👍

@Sly777

This comment has been minimized.

Copy link

commented Nov 2, 2018

@Parth1029 thanks it works on my app as well!

@rravithejareddy

This comment has been minimized.

Copy link

commented Nov 3, 2018

still i am facing the issue.

@xring

This comment has been minimized.

Copy link

commented Nov 5, 2018

@ Parth1029 Great work! Thx.

@rravithejareddy

This comment has been minimized.

Copy link

commented Nov 5, 2018

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

@marianoarga

This comment has been minimized.

Copy link

commented Nov 12, 2018

Upgrading Flutter should fix it @rravithejareddy

@rravithejareddy

This comment has been minimized.

Copy link

commented Nov 13, 2018

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

@yefeidd

This comment has been minimized.

Copy link

commented Nov 23, 2018

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

@Youzhigang

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

@zuilintan

This comment has been minimized.

Copy link

commented Dec 28, 2018

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

That's right!

@alitavanaali

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jun 11, 2019

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

This comment has been minimized.

Copy link

commented Jun 27, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.