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

。_饼干妹妹 提交于 2019-12-11 06:13:22

问题


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

  • ADT_HOME /* This is basically android path */
  • ANT_HOME
  • GIT_HOME
  • JAVA_HOME

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


回答1:


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.




回答2:


The recent Android SDK tools removed the android command.

This issue is resolved recently in Cordova. Check out this link for more info on this

You can also downgrade your tools to a version where the android was still available.

Hope it helps



来源:https://stackoverflow.com/questions/43045390/build-failing-for-android-target-on-tools-for-apache-cordova-visual-studio-pro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!