When building an ionic app in Visual Studio 2015 Professional, targeting an Android emulator, I get the following error:
------ Build configuration options: --debug
Executing "before_compile" hook for all plugins.
ANDROID_HOME=C:\Users\XXXXXXX\AppData\Local\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_112
MSBUILD : cordova-build error : Requirements check failed for JDK 1.8 or greater
Notice JAVA_HOME is pointing to a 1.8 JDK. I AM able to:
- Compile/Run with Ripple
- Compile/Run on an iOS simulator
- Compile/Run on an ANDROID emulator via the Ionic command line via:
ionic emulate android
I battled this same problem with the command line for ionic, but solved by updating my PATH environment variables to point to a 1.8 JDK in addition to the JAVA_HOME. Is it possible that Visual Studio/MSBuild are picking up a different PATH environment variable?