"flutter run" gets stuck at "Running Gradle task 'assembleDebug"

11,040

Solution 1

The issue has been resolved upstream. If you want to consume it you will have to switch to the master channel (for now. It will arrive in the stable channel at some point) by running

flutter channel master

After running that, I was able to build my apk just fine on Linux 5.5

Solution 2

flutter clean worked for me

I had the same issue. I tried so many solutions and finally found on Github. Try this command in the terminal.

Solution 3

I had the same problem and solved it. I ran flutter doctor --android-licenses as sudo. I used the whole path, don't know if that's necessary though.

For example I did it like that: sudo /home/jan/development/languages+devtools/flutter/bin/flutter doctor --android-licenses

After that everything worked.

Share:
11,040
Georgi Koemdzhiev
Author by

Georgi Koemdzhiev

I like programming, it's a passion. I work with different technologies like ASP.NET Core, Flutter and AWS. AWS Certified Developer – Associate

Updated on June 16, 2022

Comments

  • Georgi Koemdzhiev
    Georgi Koemdzhiev almost 2 years

    I updated Flutter to the latest stable version today - 1.12.13+hotfix.7 (I was running 1.12.13+hotfix.6 before). When I tried to run my project in vs code with flutter run it always gets stuck at Running Gradle task 'assembleDebug:

    enter image description here

    Have anyone experienced the same issue?

    Here is the output of flutter doctor -v:

    [georgi@georgi-pc Line-up-Generator]$ flutter doctor -v
    [✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Linux, locale en_GB.UTF-8)
        • Flutter version 1.12.13+hotfix.7 at /home/georgi/Development/flutter
        • Framework revision 9f5ff2306b (2 weeks ago), 2020-01-26 22:38:26 -0800
        • Engine revision a67792536c
        • Dart version 2.7.0
    
    [!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
        • Android SDK at /home/georgi/Android/Sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-29, build-tools 29.0.2
        • Java binary at: /opt/android-studio/jre/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
        ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
    
    [!] Android Studio (version 3.5)
        • Android Studio at /opt/android-studio
        ✗ Flutter plugin not installed; this adds Flutter specific functionality.
        ✗ Dart plugin not installed; this adds Dart specific functionality.
        • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    
    [✓] Connected device (1 available)
        • MI 8 • 62fb6fd8 • android-arm64 • Android 10 (API 29)
    
    ! Doctor found issues in 2 categories.
    
    

    I have to point out that I have tried running flutter doctor --android-licenses but it gets stuck at 25%

    enter image description here

    Note: I am on Manjaro 18.1.5

    UPDATE: There seems to be an issue with Dart SDK: https://github.com/flutter/flutter/issues/49185#issuecomment-589968058

  • Georgi Koemdzhiev
    Georgi Koemdzhiev about 4 years
    Hmm, interesting... did you try that with Kernel 5.5?
  • Jänner
    Jänner about 4 years
    @GeorgiKoemdzhiev yeah I did that. It works just fine on my laptop.
  • Jänner
    Jänner about 4 years
    @GeorgiKoemdzhiev I strongly recomment to not follow my advice. By the time I wrote my answer everything somehow worked. The next day I had massive problems and today I figured out that it's the kernels fault. Please excuse me if you followed my advice and wasted your time. :(
  • Georgi Koemdzhiev
    Georgi Koemdzhiev about 4 years
    Thank you for your comment, I did not have a chance to try your suggestion yet, thank you for lettime me know. Much appreciated :)
  • Georgi Koemdzhiev
    Georgi Koemdzhiev almost 4 years
    At the time I did try this command and it didn't help me, perhaps in your situation, it was a different problem. With me, it was the kernel version that was throwing things off and required a change in the flutter framework
  • Modi Harsh
    Modi Harsh almost 4 years
    Okay, no problem. If someone having Running Gradle task 'assembleDebug'... takes too much time or ran out of heap space. So, they can use this command.
  • Lidor Eliyahu Shelef
    Lidor Eliyahu Shelef almost 4 years
    I'm on windows and I did that, and still it gets stuck
  • Hyder khan
    Hyder khan over 3 years
    I was stuck and i used this command. While this command was still under processing, application got executed on my phone. Now i am not sure if this command made it to do so or it was just a co-incidence.