Common Flutter Not Working Issues And Fixes

Every now and then my Android Studio breaks down because something changed. A Windows update here. An environment change for a different project there. Here are the common issues I face, how I fixed them and I hope they also work for you.

ISSUE: Android Emulator Hypervisor Driver for AMD Processors installation failed

Here is the console output:

Android SDK is up to date.
Running Android Emulator Hypervisor Driver for AMD Processors installer
[SC] ControlService FAILED 1062:

The service has not been started.

[SC] DeleteService SUCCESS
[SC] StartService FAILED with error 4294967201
Andoird Emulator Hypervisor Driver for AMD Processors installation failed. To install Android Emulator Hypervisor Driver for AMD Processors follow the instructions found at: https://github.com/google/android-emulator-hypervisor-driver-for-amd-processors
Done

What’s going on: Your virtualization is not enabled on your BIOS.

How to fix Android Emulator Hypervisor Driver for AMD Processors installation failed (Windows only):

  • Restart your computer. While it’s loading in, press F2 repeatedly until the BIOS page comes up
  • Navigate around until you find the virtualization option. Enable it. Save and exit.

Notes: for AMD Processors, Virtualization can be abbreviated to SVM Mode and is located inside the Advanced option.


ISSUE: no JAVA_HOME

Here is the console output:

ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

How to fix no JAVA_HOME (Windows only):

  • click on the Start button
  • type env, hit enter
  • Select Environment Variables
  • Click on ‘New…’
  • Fill in the variable name field with JAVA_HOME
  • Fill in the variable value with where your Java jdk is on your computer. If you don’t have a Java jdk, you can download it at the official site here and then go through the steps to add the path.
  • Click OK, and then OK again to exit out. The no JAVA_HOME issue should disappear.

ISSUE: Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

Here is the console output:

Launching lib\main.dart on Android SDK built for x86 in debug mode…
 Running Gradle task 'assembleDebug'…
 FAILURE: Build failed with an exception.
 What went wrong:
 Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
 Try:
 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
 Get more help at https://help.gradle.org 
 BUILD FAILED in 960ms
 Exception: Gradle task assembleDebug failed with exit code 1

How to fix Gradle task assembleDebug failed with exit code 1:

In your project folder, navigate to gradle>wrapper>gradle-wrapper.properties

Change your distributionUrl to:

https\://services.gradle.org/distributions/gradle-6.4.1-all.zip

So it should look something like this:

Comments

0 comments

About Author /

I code. I write. I hustle. Living the #devLife remotely. Subscribe to my newsletter to stay connected with my latest posts and dev thoughts. Want to collaborate? DM me on LinkedIn

Start typing and press Enter to search