Flutter stuck on initializing graddle

January 30, 2019

You probably just installed the whole Flutter by following the getting started guide neatly, and see your build of the test app getting stuck at "Initializing graddle...".

Do note that the first launch of graddle will take some time, even on a good computer and fast internet (for me it was around 20 minutes).

Before you stop and try to rebuild, I suggest you enable verbose building output. (Scroll down) so you see what is actually happening.

Also make sure you have set your system PATH correctly.

Accepting licenses

This is something that wasn't reported to me upon trying to build the example application.

Open your terminal (or command line for windows users) and enter the following command, follow the steps as described. If nothing happens, make sure you have set your PATH correctly.

flutter doctor --android-licenses

Validate your Flutter SDK

Open up your terminal and enter the following command.

flutter doctor -v

If everything is setup correctly, it should output something like the following,

flutter doctor -v
[â] Flutter (Channel stable, v1.0.0, on Linux, locale en_US.UTF-8)
    ⢠Flutter version 1.0.0 at /home/gilles/development/flutter
    ⢠Framework revision 5391447fae (9 weeks ago), 2018-11-29 19:41:26 -0800
    ⢠Engine revision 7375a0f414
    ⢠Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[â] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    ⢠Android SDK at /home/gilles/Android/Sdk
    ⢠Android NDK location not configured (optional; useful for native profiling
    ⢠Platform android-28, build-tools 28.0.3
    ⢠Java binary at: /usr/local/android-studio/jre/bin/java
    ⢠Java version OpenJDK Runtime Environment (build
    ⢠All Android licenses accepted.
[â] Android Studio (version 3.3)
    ⢠Android Studio at /usr/local/android-studio
    ⢠Flutter plugin version 32.0.1
    ⢠Dart plugin version 182.5124
    ⢠Java version OpenJDK Runtime Environment (build
[â] Connected device (1 available)
    ⢠Android SDK built for x86 ⢠emulator-5554 ⢠android-x86 ⢠Android 9 (API
      28) (emulator)

Try your build

Now try to run your application in your emulator, note that the first time graddle is being launched it will take some time.

Enable verbose build output

I assume you are using Android Studio as your IDE, if not, just add the '-v' flag to your build arguments. In Android Studio you can do so by: