Flutter project running error A problem occurred configuring root project 'android'. Solution

The error is as follows

* Error running Gradle : 
ProcessException : Process "C:\Users\shunyue\mydemo\flutter_app\android\gradlew.bat" 
Starting a Gradle Daemon ( subsequent builds will be faster )


FAILURE : Build failed with an exception .

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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

insert image description here

The workaround is as follows:

Find the build.gradle file in the android folder in the project.
As shown in the figure below, if adding two mavenCentral()
insert image description here
s still does not work, just add mavenCentral() to the above one

Finally, connect the phone to the computer and turn on the USB debugging of the phone.
Next, let's run it again and see:
insert image description here
Okay, it's successful!

Tags: Flutter project running error A problem occurred configuring root project 'android'. Solution

Flutter android android

Related: Flutter project running error A problem occurred configuring root project 'android'. Solution