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

后端 未结 30 3407
你的背包
你的背包 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:47

    In Android Studio:

    Tools -> Flutter -> Flutter clean.

    After that just run the app

    0 讨论(0)
  • 2020-12-08 18:49

    Had the same issue because of the wrong compileSdkVersion in the build.gradle file. Working fine now.

    0 讨论(0)
  • 2020-12-08 18:49

    This worked for me:

    C:\Users<user>\AndroidStudioProjects<flutter_app>\android> gradlew clean C:\Users<user>\AndroidStudioProjects<flutter_app>\android> gradlew build

    Now run it, for initial build

    “Running Gradle task 'assembleDebug'… ”
    

    will take 10-12 mins after that it will be good to go.

    0 讨论(0)
  • 2020-12-08 18:51

    I solved the issue by reinstalling SDK Platform on Android studio for Android API 29

    Tools->SDK Manager-SDK Platform
    

    Next go to

    Android > app > build.gradle
    

    Make sure you also change

    compileSdkVersion 29
    
    targetSdkVersion 29
    

    Be patient, it take longer for the first launch...But, not take forever like before.

    good luck

    0 讨论(0)
  • 2020-12-08 18:52

    For creating an apk for Android in Flutter this issue sometimes happens. I had the luck of facing this issue as well. Here are the few ways it can be solved:

    1. Due to androidX
    

    If you followed recommended route from here: https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility

    Try this:

    Check with steps in “not recommended” way in above tutorial if every listed files is same as in your project, especially : in root/android/gradle/wrapper/gradle-wrapper.properties set distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip in root/android/build.gradle, set dependencies { classpath 'com.android.tools.build:gradle:3.3.2' }

    check if root/android/app/build.gradle SDK version is set to minimum 28 for: compileSdkVersion 28 and targetSdkVersion 28 Thank you.

    0 讨论(0)
  • 2020-12-08 18:54

    I fixed the issue by switching off my antivirus while running my project in the terminal

    To run your project in a terminal simply type --> flutter run

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