构建Android平台的要求未得到满足 [英] Requirements for building the android platform not satisfied

查看:125
本文介绍了构建Android平台的要求未得到满足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Cordova世界的新手,因此我正在尝试构建和运行我的第一个应用程序.为此,我正在按照科尔多瓦官方页面上列出的步骤进行操作,但是在构建阶段遇到错误.

I'm a newcomer to the Cordova world, so I'm attempting to build and run my first app. To do so, I'm following the steps set out in the official Cordova page but I'm getting an error at the build stage.

显然,android平台已成功添加:

Apparently, the android platform is added successfully:

D:\Users\user\workspace\cordova\helloworld>cordova platform add android
Using cordova-fetch for cordova-android@~6.3.0
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: com.example.helloworld
        Name: HelloWorld
        Activity: MainActivity
        Android target: android-26
Subproject Path: CordovaLib
Android project created with cordova-android@6.3.0
Installing "cordova-plugin-whitelist" for android

This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
--save flag or autosave detected
Saving android@~6.3.0 into config.xml file ...

但是当我检查是否满足构建阶段的先决条件时,会出现以下错误:

But when I check if the pre-requisites for the build stage are met, I get the following error:

D:\Users\user\workspace\cordova\helloworld>cordova requirements
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
cmd: Command failed with exit code 1 Error output: "avdmanager" no se reconoce como un comando interno o externo, programa o archivo por lotes ejecutable.
Gradle: installed C:\Program Files\Gradle\gradle-4.3.1\bin\gradle
Error: Some of requirements check failed

我不仅仅理解,只要cordova platform add android命令成功运行,怎么可能没有安装Android目标.我在做什么错了?

I don't just understand how is it possible no Android target is installed as long as the cordova platform add android command worked successfully. What am i doing wrong?

我已经安装了以下工具(Windows 7 x64):

I've got the following tools installed (Windows 7 x64):

  1. JDK 1.8.0
  2. Android SDK 25.2.5
  3. 4.3.1级
  4. 节点8.9.1
  5. 科尔多瓦7.1.0

我认为环境变量设置正确:

I think the environment variables are set ok:

ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
GRADLE_PATH=C:\Program Files\Gradle\gradle-4.3.1
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_152
Path= ... ; C:\Program Files\nodejs\;
      D:\Users\user\AppData\Roaming\npm;
      C:\Program Files\Java\jdk1.8.0_152\bin;
      C:\Program Files (x86)\Android\android-sdk\platform-tools;
      C:\Program Files (x86)\Android\android-sdk\tools;
      C:\Program Files\Gradle\gradle-4.3.1\bin

我想说的是我没有安装Android Studio,因为我更喜欢使用eclipse + ADT插件.要安装Android SDK工具,我从互联网上获得了安装程序.exe(版本24.4.1),该安装程序在首次运行时会自动更新.正如我所说,Android SDK的当前版本为25.2.5.在Android SDK Manager中,我安装了API级别21-26,可以在ANDROID_HOME \ platforms(android-21,android-22,...,android-26文件夹)中看到这些API.

I'd like to say that I didn't install Android Studio as I prefer to use eclipse+ADT plugin. To install the Android SDK tool I got from the Internet an installer .exe (version 24.4.1) which got updated automatically on first run. Current version of Android SDK, and as I said, is 25.2.5. From the Android SDK Manager I installed API levels 21 - 26, which I can see within the ANDROID_HOME\platforms (android-21, android-22, ..., android-26 folders).

任何关于正在发生的事情的解释将不胜感激. 谢谢.

Any explanation about what is happening would be appreciated. Thanks.

推荐答案

尝试在清单文件,项目中更改目标api版本.平台文件夹(android)中的属性和Cordovalib文件夹中的project.properties

Try changing the target api version in manifest file, project. properties in platform folder (android)and project.properties in Cordovalib folder

这篇关于构建Android平台的要求未得到满足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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