gpt4 book ai didi

android - cordova 要求问题,未安装 android 目标

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:42:49 24 4
gpt4 key购买 nike

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

当我运行 cordova requirements 时,它说 android target is not intalled并设置 ANDROID_HOME 环境变量

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 时,它已设置到正确的位置。我无法解决此错误。请帮我解决这个问题

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

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

并且项目属性文件中的 android 目标设置为:android-25我:\CordovaProject\hello\platforms\android\CordovaLib\project.properties
我:\CordovaProject\hello\platforms\android\project.properties

当我运行 cordova build android 时出现以下错误

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

关于android - cordova 要求问题,未安装 android 目标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43448888/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com