org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'DemoAppppp'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94)
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath'.
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:944)
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.android.tools.build:gradle:3.2.1.
Required by:
project :
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolveModule(RepositoryChainComponentMetaDataResolver.java:103)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolve(RepositoryChainComponentMetaDataResolver.java:63)
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.android.tools.build:gradle:3.2.1.
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.resolveComponentMetaData(ErrorHandlingModuleComponentRepository.java:139)
Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
at org.gradle.internal.resource.ResourceExceptions.failure(ResourceExceptions.java:74)
at org.gradle.internal.resource.ResourceExceptions.getFailed(ResourceExceptions.java:57)
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:96)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:80 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
Caused by: java.net.ConnectException: Connection refused: connect
Update
I just followed @CoolMind answer it solve the gradle issue, but there is another issue comes which is This
And I followed those answers which is given in this question but not solve my problem
–
–
Click on Gradle
2nd number option(just near of Setting option)
click on it then you will be able to do work continuously.
As you can see the image
–
–
–
–
In The Right Side of the Android Studio, You can See Gradle option just click it and you will see a screen which is given below.
Gradle can be offline. If offline, you should do it online.
–
–
I had this problem also. Tried all the suggestions, but didnt help. The problem was in offline/online mode as other stated but you have to also check the compiler settings. Make sure there is no --offline flag
Preferences -> Build, Execution, Deployment -> Compiler
( Menubar 'File' button, 'Settings' menu option, 'Build, Execution, Deployment' menu twisty, 'Compiler' submenu )
On Command-line Options: --stacktrace
--offline --stacktrace
Opening the "Gradle" side panel, and toggling the "online/offline" button to "online" worked for me as well.
Previous failed solution: I searched on Gradle's website for a manual download of version 3.6.3, but there wasn't one. That number is the same version, however, of Android Studio being used.
This problem appeared on OS X. After disabling web filtering application (some Google IPs were blocked) it disappeared. After syncing with gradle all files have been downloaded.
Also you may set a checkbox like in https://discuss.gradle.org/t/android-studio-could-not-get-resource-https-dl-google-com-dl-android-maven2-com-android-tools-build-gradle-3-1-0-gradle-3-1-0-pom/26734:
Settings -> Build … -> Gradle -> Android Studio -> Enable embedded maven repository.
See also Could not resolve com.android.tools.build.gradle:3.0.1.
–
If you have updated Gradle then most likely you will get this error because Gradle will be offline by default after updating.
Solution:
In right hand side top corner click Gradle (Gradle panel or Gradle window opens).
Connect Gradle to the internet by clicking the icon at the top of Gradle panel or window.
This problem occurs when your android studio is not getting internet connection. You fix the internet, the problem fixes by itself.
To confirm the internet issue of the android studio you can attempt to login, update, connecting to firebase, etc all will fail.
–
I also have been having the same error since when i updated my Android studio and even with a fast internet network am unable to start a new project but today I discover a solution just click o your event log and update any suggested plugin that shows up and rebuild your project, then your have your project working well and fine it worked for me trust it to work for you also .
–
Try to Toggle Offline Mode, if not worked check your flipper version if it is old try to update it(worked for me). Upgrading flipper version in gradle.properties
FLIPPER_VERSION=0.39.0
FLIPPER_VERSION=0.99.0
In my case I added maven repository in both repository section , so this issue occurs, So I removed this line from above repotories section inside buildscript
for reference visit this answer https://stackoverflow.com/a/75005827/12748481