cordovavisual-studio-2015msbuildionic2taco

Visual Studio Cordova Build Error - JDK 1.8 or Greater


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:

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?


Solution

  • 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

    From the error log, VS is already using JDK 1.8. Please clear the cordova cache and remove the android platform and build again.