Flutter App stuck at “Running Gradle task 'assembleDebug'… ”

后端 未结 30 3504
你的背包
你的背包 2020-12-08 18:28

When I run the app it get stuck

Launching lib\\main.dart on Lenovo A319 in debug mode...
Running Gradle task \'assembleDebug\'...
(This is taking an unexpec         


        
30条回答
  •  自闭症患者
    2020-12-08 18:56

    flutter run -v showed that I was stuck on

    Downloading https://services.gradle.org/distributions/gradle-5.6.2-all.zip

    This was going to take hours, as for some reason the download speed was ~10kB/s on a decent DSL connection.

    Solution:

    1. Interrupt gradle build
    2. Download the required gradle zip from a fast mirror: https://distfiles.macports.org/gradle/gradle-5.6.2-all.zip
    3. Copy gradle-5.6.2-all.zip to C:\Users\ \.gradle\wrapper\dists\gradle-5.6.2-all\9st6wgf78h16so49nn74lgtbb (of course the last folder will have a different name on your PC)
    4. flutter run and voilà.

提交回复
热议问题