androidcordovavisual-studio-2015taco

Build failing for Android target on Tools for Apache Cordova - Visual studio Professional 2015


There is a cordova project developed using Visual Studio - Tools for Apache Cordova (TACo).

While building the project for iOS target, we are able to get the build and debug successfully, on simulator as well on real iOS device.

But while building the same for Android target, it is working with Ripple browser emulators but it is not working with Android emulator or Android real devices.

I have tried updating environment variables manually as well through VS > Tools > Options > Tools for Apache Cordova > Environment Variables Overrides option, which includes

I have also verified ANDROID_PATH environment variable value in System Variables, and checked in command prompt using "echo %ANDROID_HOME%", it prints: C:\Program Files (x86)\Android\android-sdk;

VS > Tools > Options > Tools for Apache Cordova > Environment Variables Overrides

Require guidance where should the change is required.

Here is the Build error log:

MSBUILD : cordova-build error : Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable. Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable. (TaskId:10) Done executing task "MdaVsCli" -- FAILED. (TaskId:10)

Done building target "BuildMDA" in project “MyProjectName.jsproj" -- FAILED.: (TargetId:11)

Project Performance Summary: 4704 ms C:\MyProjectDir\MyProjectName.jsproj 1 calls 4704 ms build 1 calls


Solution

  • The issue was related to Environment Variable only. I used to add semicolon at the end of all the file locations, but for JAVA_HOME, if we add semicolon it is not working with VS TACo.

    Hence, i removed the semicolon from the end, and now the JAVA_HOME looks like this:

    JAVA_HOME = C:\Program Files (x86)\Java\jdk1.8.0_60

    App is now working with Android simulator as well.