Flutter app stuck at "Running Gradle task 'assembleDebug'..."

- Andrés Cruz

En español

Flutter app stuck at "Running Gradle task 'assembleDebug'..."

A very common problem when developing applications in Flutter is that, when running in an Android project, it stops responding and gets stuck; for this, we have the following commands:

Open your flutter project folder.

  • Change directory to the android directory in your flutter project directory cd android
  • Clean gradle: ./gradlew clean
  • Compile gradle ./gradlew build
  • Or you can combine both commands with just ./gradlew clean build
  • Now run your flutter project. If you are using vscode, press F5. The first time gradle runs assembleDebug it will take time.

This command gives a lot of information about whether there are any missing configurations, packages, etc about your project; so, in case the execution fails, you must be aware of possible errors that it throws.

I agree to receive announcements of interest about this Blog.

Let's see how we can fix the problem that the application in Flutter using Android gets stuck "Running Gradle task 'assembleDebug'..."

- Andrés Cruz

En español