6

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
  • 11,421
  • 18
  • 62
  • 126
  • 2
    In most cases it is best to just copy and paste the output so that everyone has a easier time working with it instead of posting images. – Jakob F Feb 09 '20 at 23:01
  • 2
    Yes, good point. I have replaced `flutter doctor -v` output with text – Georgi Koemdzhiev Feb 09 '20 at 23:37
  • Can you install flutter plugin in android studio first – Dev Feb 10 '20 at 04:20
  • I had some build issues recently due to dependency issues (it also got stuck, without giving any warning). Do these problems persist when you try to run a completely fresh/new Flutter app? – Tom O Feb 10 '20 at 08:40
  • @Dev I will try that when I get home. Tom, I remember trying that with `flutter create --androidx -t app /path/to/app` and it was running fine after – Georgi Koemdzhiev Feb 10 '20 at 10:03
  • 1
    https://stackoverflow.com/questions/60116341/gradle-getting-stuck-at-assembledebug – Prathik Feb 10 '20 at 13:15
  • Thanks @PrathikJain! I actually updated the kernel to `5.5` recently but I thought that the problem is somewhere else. I will test later today if downgrading to an older version (i.e. 5.2) will fix the issue. – Georgi Koemdzhiev Feb 10 '20 at 13:28
  • @PrathikJain that solved it! Downgrading to kernel `5.4.17-1` solved the issue! T (it's a LTS so I should've staid with this one anyway, I updated it for no reason). The Flutter team probably tests against LTS versions of the kernel – Georgi Koemdzhiev Feb 10 '20 at 19:43

4 Answers4

5

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.

Modi Harsh
  • 555
  • 4
  • 7
  • 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 – Georgi Koemdzhiev May 28 '20 at 07:28
  • 1
    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. – Modi Harsh May 28 '20 at 08:36
  • 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. – Hyder khan Jan 13 '21 at 08:08
4

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

Georgi Koemdzhiev
  • 11,421
  • 18
  • 62
  • 126
2

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.

Jänner
  • 39
  • 2
  • 5
  • 1
    Hmm, interesting... did you try that with Kernel 5.5? – Georgi Koemdzhiev Feb 23 '20 at 19:07
  • 1
    @GeorgiKoemdzhiev yeah I did that. It works just fine on my laptop. – Jänner Feb 23 '20 at 19:54
  • 2
    @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. :( – Jänner Feb 27 '20 at 20:58
  • 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 Feb 27 '20 at 21:10
-1

I tried every answer I found about it, but none of them worked.

Finally I fixed it by deleting the Android Virtual Device I had and creating a new one. In my case looks like it was a problem with the android emulator rather than a flutter bug.

Denismr7
  • 559
  • 5
  • 3