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

A problem occurred configuring root project 'android'. #51604

Closed
shunyue1320 opened this issue Feb 28, 2020 · 9 comments
Closed

A problem occurred configuring root project 'android'. #51604

shunyue1320 opened this issue Feb 28, 2020 · 9 comments

Comments

@shunyue1320
Copy link

shunyue1320 commented Feb 28, 2020

My mistake:

* Error running Gradle:
ProcessException: Process "C:\Users\shunyue\mydemo\flutter_app\android\gradlew.bat" exited abnormally:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.

My solution:
modification android\build.gradle

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

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

allprojects {
    repositories {
        google()
        mavenCentral()   //add
        jcenter()
    }
}
@jonahwilliams
Copy link
Member

This is a problem that could be caused by lacking access to the google or jcenter mirrors. It sounds like you solved the issue though?

@jonahwilliams jonahwilliams added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 28, 2020
@shunyue1320
Copy link
Author

This is a problem that could be caused by lacking access to the google or jcenter mirrors. It sounds like you solved the issue though?

yes, That's how I solved it

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 28, 2020
@jonahwilliams
Copy link
Member

Coolio. In general there isn't really much we can do about this. If the issue is solved I'm going to close the bug.

@Howarduan
Copy link

I have met the same problem, and my gradle script is:
repositories {
google()
jcenter()
mavenLocal()
}
and I change it to:
repositories {
google()
jcenter()
mavenLocal()
mavenCentral()
}
but the errors still exist.

@Adamsay93a
Copy link

Hello Shunyue1230, please how did you modify your android/build.gradle as you stated up there. I'm new to coding and even flutter, I'm experiencing the same problem but I don't know how to go about your solution.

@shunyue1320
Copy link
Author

@Adamsay93a answer is above ↑
Between google() and jcenter() add to mavenCentral()

I don’t know if it’s useful now, and it’s been a long time!

@shunyue1320
Copy link
Author

shunyue1320 commented Nov 26, 2020

@Adamsay93a
If it is because gradle-x.x-all.zip download failed
Go to the gradle-x.x-all.zip to download
Don’t unzip and copy to your folder after downloading: C:\Users\yourUserName\.gradle\wrapper\dists\gradle-x.x-all\xxxxxx\ in window

Download the version here:
image

@TheGuysWhoCode
Copy link

Hello Shunyue1230, please how did you modify your android/build.gradle as you stated up there. I'm new to coding and even flutter, I'm experiencing the same problem but I don't know how to go about your solution.

For me I solved that issue by downloading gradle and extracting it in the root folder of android studio. and add it to the system variables path and go in android studio > settings > Build, Exception, Deployment. and point it to the folder where you extracted you gradle. Download gradle from here https://services.gradle.org/distributions/

@github-actions
Copy link

github-actions bot commented Aug 5, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2021
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

5 participants