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

后端 未结 30 3408
你的背包
你的背包 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 19:05

    In my case the Android Gradle Plugin Version was not updated to any version at all. So i updated it by right clicking on my project folder, clicked "Open Module Settings" and updated gradle plugin version accordingly.

    0 讨论(0)
  • 2020-12-08 19:07

    In my case, Windows Firewall was causing this problem. After I disabled it temporarily the problem was gone. Worth giving it a try. Good luck!

    0 讨论(0)
  • 2020-12-08 19:07

    Have you tried that from cli ?

    flutter devices

    flutter run

    https://flutter.dev/docs/get-started/test-drive?tab=terminal

    In a mac environment, the building process finished in 140s.

    0 讨论(0)
  • 2020-12-08 19:08

    Finally i fixed it. The problem is mostly due to android SDK or gradle built tool

    There are different ways you can try to fix it. way 1. check whether google drivers are installed . you can find them in sdk manager of the android studio

    way 2. flutter doctor -v flutter doctor --android-licenses (#this will check whether all the licenses of android are accepted)

    way 3. flutter clean;flutter build apk
    flutter run ( In the start it will take time for assembledeubg so kindly be patient for 7 to 10 mins)

    way 4. If this also do not work flutter clean flutter run (be patient and finally after 5 to 10 min your flutter code will run on the emulator)

    Hope these solutions work for you, If not reply me back.

    0 讨论(0)
  • 2020-12-08 19:08

    In my case installing JDK solved the problem.

    macOS Catlina v10.15.4

    0 讨论(0)
  • 2020-12-08 19:09

    It is taking time on windows 10 as the Android studio needs firewall permission to connect to the device(AVD). There can be another reason that you don't have downloaded full Android SDK on your machine.
    To check the issue simply run the command on your terminal/cmd/PowerShell command tool.

    flutter doctorflutter doctor

    check if SDK is installed or not. Try to install and accept license using the following command

    flutter doctor --android-licenses

    If this doesn't resolve your problem then go to android studio and Open your Android Studio,

    File-> settings->System settings(left tab) ->Android SDK ,

    go to SDK Tool section in that page,

    untick hide obsolete packages,

    select Android SDL tools(obsolete) and press apply also install other useful tools according to your convenience.

    0 讨论(0)
提交回复
热议问题