How do I setup Cordova?

谁说我不能喝 提交于 2020-01-13 12:07:16

问题


I am having some problems with getting started with my first Cordova app in Visual Studio.

When I create a new Cordova Project, I am presented with a page that says:

We've detected issues with your system's environment configuration

And it lists 3 things that need to be installed:

  • Android SDK The software is missing from your system. You may also have to configure it after installation. Instructions
  • Apache Ant The software is missing from your system. You may also have to configure it after installation. Instructions
  • Git CLI The software is missing from your system. You may also have to configure it after installation. Instructions

    1. I already have the Android SDK installed. So how can I let Visual Studio know where it is? A search for this on Google did not yield any results that were related.

    2. Searching for Git CLI did not yield any results. How do I install this?

    3. I haven't even tried installing Apache Ant yet because I can't get past the other two.

How can I install Git CLI and how do I let VS know where my Android SDK is located?

P.S. I am aware that each of those list items has an 'instructions' link, however, I am unable to access those pages, they say "Webpage is not accessible" in Chrome, Firefox and IE (and Spartan).


回答1:


I guess you have already installed Tools for Apache Cordova.

Once you did that and you can't install them with the tool, download them manually in their official websites. You can then add the path for these items in :

Tools > Options > Tools for Apache Cordova > Environment Variables

Here is a screen of mine :

I hope it helps




回答2:


Not sure these are solutions, but something to check for:

If you're using VS2013, ensure you have update 4. Visual Studio Tools for Cordova only relies runs on VS 2013 and 2015.

Of course, ensure you have the latest Tools for Cordova CTP 3.1 (http://www.microsoft.com/en-us/download/details.aspx?id=42675)

In my system path, I have C:\Program Files (x86)\Android\android-sdk\platform-tools. I have ANT_HOME as a system/environment variable set to C:\apache-ant-1.9.3. I have ADT_HOME as a system/environment variable set to C:\Program Files (x86)\Android\android-sdk. I have GIT_HOME set to C:\Program Files (x86)\Git.




回答3:


Setup your PATH environment variable on Windows

From the Desktop, right-click My Computer and click Properties. Click Advanced System Settings link in the left column. In the System Properties window click the Environment Variables button. Select the PATH variable from the System variables section. Select the Edit button. You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use "C:\Development\android-sdk-windows" as the directory the SDK is installed in. Append the following text into the text box: ;C:\Development\android-sdk-windows\platform-tools;C:\Development\android-sdk-windows\tools

Save your edit. Close the Environment Variables dialog. Additionally, you may need to include %JAVA_HOME%\bin to your PATH as well. To check to see if this is required, run a command prompt and type java. If the program can not be found add %JAVA_HOME%\bin to the PATH. You may need to specify the full path instead of using the %JAVA_HOME% environment variable. Finally, you may need to include %ANT_HOME%\bin to your PATH as well. To check to see if this is required, run a command prompt and type ant. If the program can not be found add %ANT_HOME%\bin to the PATH. You may need to specify the full path instead of using the %ANT_HOME% environment variable.



来源:https://stackoverflow.com/questions/29520466/how-do-i-setup-cordova

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