报错如下
* 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调试
接下来我们再次运行看看:
好啦,成功啦!