1

this is my first time using a MAC computer and i'm trying to run it on an android device (the iphone works fine) but i recieve a error message when i try to compile the file on the android emulator

The error message is:

Launching lib/main.dart on sdk gphone x86 in debug mode...
lib/main.dart:1
ERROR: JAVA_HOME is set to an invalid directory: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Apreciace all help, thank you.

Shaven
  • 11
  • 1
  • This question has been addressed multiple times: https://stackoverflow.com/questions/45182717/java-home-is-set-to-an-invalid-directory Try what I did: https://stackoverflow.com/a/63844018/2041475 You can find the gradlew.bat file in root/android folder – MikkelT Jul 29 '21 at 15:42
  • This both links are for windows machines – Shaven Jul 29 '21 at 15:47
  • http://www.sajeconsultants.com/how-to-set-java_home-on-mac-os-x/ Did you try this? It differs from mac to mac I've experinced. Kind of a hassle – MikkelT Jul 29 '21 at 15:48
  • This one doens't work too, i think this is for an older version of mac, cause the newest one (Big Sur) doensn't have emac – Shaven Jul 29 '21 at 15:58

0 Answers0