cordova需求问题,未安装android target [英] cordova requirements issue , android target not installed

查看:560
本文介绍了cordova需求问题,未安装android target的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows 7上安装Cordova. 我正在关注本教程: https://www.tutorialspoint.com/cordova/cordova_first_application.htm

I am trying to install Cordova on windows 7. I am following this tutorial : https://www.tutorialspoint.com/cordova/cordova_first_application.htm

当我运行 cordova要求时,它表示未安装android target 并设置ANDROID_HOME环境变量

while I run cordova requirements, it says android target is not intalled and set the ANDROID_HOME environment variable

I:\CordovaProject\hello>cordova requirements
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
Android SDK not found. Make sure that it is installed. If it is not at the 
default location, set the ANDROID_HOME environment variable.
Gradle: installed
Error: Some of requirements check failed

I:\CordovaProject\hello>echo %ANDROID_HOME%
C:\Users\user\AppData\Local\Android\sdk

正如您在图像1中看到的那样,

当我回显ANDROID_HOME时,它被设置为正确的位置.我无法解决此错误.

as you can see in the image 1, when I echo ANDROID_HOME it is set to proper location. I am not able to resolve this error. kindly help me with this

路径具有这些:%ANDROID_HOME%\ tools;%ANDROID_HOME%\ platform-tools

path has these : %ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

我已经在android studio中下载了android-25

I have downloaded android-25 in android studio

和项目属性文件都将android target设置为:android-25 I:\ CordovaProject \ hello \ platforms \ android \ CordovaLib \ project.properties
I:\ CordovaProject \ hello \ platforms \ android \ project.properties

and project properties file has android target set to : android-25 both in I:\CordovaProject\hello\platforms\android\CordovaLib\project.properties
I:\CordovaProject\hello\platforms\android\project.properties

当我运行 cordova构建android 时,出现以下错误

and when i run cordova build android i get following error

BUILD FAILED

Total time: 31.807 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
 > Could not resolve all dependencies for configuration ':classpath'.
 > Could not download uast.jar (com.android.tools.external.com-
 intellij:uast:145.597.3)
  > Could not get resource 'https://jcenter.bintray.com/com/android/tools/ex
 ternal/com-intellij/uast/145.597.3/uast-145.597.3.jar'.
     > Could not GET 'https://jcenter.bintray.com/com/android/tools/external
  /com-intellij/uast/145.597.3/uast-145.597.3.jar'.
        > akamai.bintray.com

  * Try:
   Run with --stacktrace option to get the stack trace. Run with --info or -
   -debug   option to get more log output.

推荐答案

对于SDK 21("android-21")

$ cordova platform remove android
$ cordova platform add android@3.7.1

对于SDK 22(Android 4.1.1,"android-22")

$ cordova platform remove android
$ cordova platform add android@4.1.1

这篇关于cordova需求问题,未安装android target的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆