I have been struggling with several build failures after installing a fresh/new system with the latest version of Android Studio (3.1) and Unity (2017.4). Failures like: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct that span multiple duplicates since offered solutions are workarounds and do not explain the root problem well and how to gracefully solve this on Mac.
In Unity -> Preferences -> External Tools I have properly set the Android SDK path to point to the one installed by Android Studio and also the JDK to point to a JDK 8 version (I know that right now the Android tools do not work with Java 9+) but I still get the build failures.
I'm looking for a solution that:
- allows me to keep multiple java versions (I use jenv)
- does not mess with symlinks in my java setup
- allows me to use my android sdk installation (I use the one in Android Studio) and does not require me to mess with it (e.g downgrading Android Tools) except by officially installing any missing module