It's a common pitfall for beginner. The error
Failed to install the app. Make sure you have the Android development environment ...
is misleading.
The real error is in the line
What went wrong: The suppplied javaHome seems to be invalid
which suggest that you should check the value of your env variable JAVA_HOME
and make sure it points to a valid Java installation directory.
And if you have checked it and cannot figure out the problem, you may find it useful to check this question (IntelliJ Gradle Plugin: The supplied javaHome seems to be invalid) out. For example, someone suggest that its possible root cause is the incompatible version (32/64 bit) of your JDK.