Bootstrap

Flutter项目运行报错 A problem occurred configuring root project ‘android‘. 解决方法

报错如下

* 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'.

在这里插入图片描述

解决方法如下:

找到项目内android文件夹内的build.gradle文件
如下图所示,添加两个mavenCentral()
在这里插入图片描述
还是不行的话就只给上面一个添加mavenCentral()

最后将手机连接电脑并打开手机USB调试
接下来我们再次运行看看:
在这里插入图片描述
好啦,成功啦!

;