1

I updated my android studio to 4.1.0 just after that my project (in flutter) has been giving this error constantly.

I downgraded my android studio back to 4.0.1 (the previous version I was using), I still am getting the same error.

I saw some articles on the same error in StackOverflow, it suggested to downgrade but it didn't work, the rest of the suggestions are too complicated for me as I am just a beginner.

I even tried changing Project SDK under Project Structure but even that didn't work. enter image description here

After installing java jdk (from oracle windowsx64) and changing path name and value as suggested here Setting JAVA_HOME , I am now getting a whole set of another error, which I basically don't understand a bit.

enter image description here

Umar Malik
  • 55
  • 7

3 Answers3

1

Kindly go through the process adding JAVA_HOME environment variable, seems JAVA is not in environment variable.

User this link: https://www.java.com/en/download/help/path.html as reference.

once done you can confirm if all is set by running javac command

  • Could you please look into your versions you are running, with Gradle check at android/gradle/wrapper/gradle-wrapper.properties and update the versions then build again. – ntonsite mwamlima Mar 02 '21 at 12:59
1

Here you can try this Set JAVA_HOME This solution for window 10

0

The first error is caused when JAVA_HOME path is missing or wrongly valued.

But be sure to check that you have JAVA jdk installed first. (I didn't and that's where everything went wrong).

Then follow this Setting JAVA_HOME and remember to put proper location with proper version number.

Even after that if you get the second error just follow this Android Studio Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

Umar Malik
  • 55
  • 7