Flutter project running error A problem occurred configuring root project 'android'. Solution
* 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' .
Find the build.gradle file in the android folder in the project.
As shown in the figure below, if adding two mavenCentral()
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:
Okay, it's successful!