先是看了别人的文章
Flutter项目启动一直卡在Running Gradle task ‘assembleDebug‘问题解决 - 灰信网(软件开发博客聚合) (freesion.com)
做了同样的处理,但接着又报错
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven3(仓库服务 to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See UrlArtifactRepository - Gradle DSL Version 7.5 for more details.
去查了一下,原因如下:
![](https://img-blog.csdnimg.cn/img_convert/1fc14b12b83f07577de5f1f7e07a8f7f.png)
解决方法:
将上面参考别人的文章一二步骤中添加的连接中的 http(下图圈起来的部分) 都改为https,即可运行成功
![](https://img-blog.csdnimg.cn/img_convert/c14462f65ce2ccf2c25c380883fa3a98.png)
![](https://img-blog.csdnimg.cn/img_convert/22b0614bc0788e5e35902e66aa002908.png)