[英]cordova: “Android SDK: not installed”
I know there are many threads like this but none of them helped. 我知道有很多这样的线程,但是它们都没有帮助。
I am using Windows 10 , Cordova 7.1.0 (latest version) and I have installed Android Studio with SDK Platform 7.1.1 - API level 25 (also tried downgrading to 7.0 - API level 24). 我正在使用Windows 10 , Cordova 7.1.0 (最新版本),并且我已经安装了Android Studio和SDK平台7.1.1-API级别25 (也尝试降级到7.0-API级别24)。 Also, I installed SDK build-tools using Android Studio SDK Manager.
另外,我使用Android Studio SDK Manager安装了SDK构建工具 。
Running: 运行:
cordova info
I get this message: 我收到此消息:
Android SDK is not set up properly.
Android SDK设置不正确。 Make sure that the Android SDK 'tools' and 'platform-tools' directories are in the PATH variable.
确保Android SDK的“工具”和“平台工具”目录位于PATH变量中。
'android' is not recognized as an internal or external command, operable program or batch file.
无法将“ android”识别为内部或外部命令,可操作程序或批处理文件。
Running 运行
cordova requirements
I get this message: 我收到此消息:
Android SDK: not installed Failed to find 'ANDROID_HOME' environment variable.
Android SDK:未安装无法找到“ ANDROID_HOME”环境变量。 Try setting setting it manually.
尝试设置手动设置。 Detected 'adb' command at C:\\Windows but no 'platform-tools' directory found near.
在C:\\ Windows中检测到“ adb”命令,但附近没有找到“ platform-tools”目录。 Try reinstall Android SDK or update your PATH to include valid path to SDK\\platform-tools directory.
尝试重新安装Android SDK或更新您的PATH,以包含SDK \\ platform-tools目录的有效路径。 Android target: not installed cmd: Command failed with exit code 1 Error output: 'android' is not recognized as an internal or external command, operable program or batch file.
Android目标:未安装cmd:命令失败,退出代码1错误输出:无法将'android'识别为内部或外部命令,可操作程序或批处理文件。 Gradle: not installed Could not find gradle wrapper within Android SDK.
Gradle:未安装在Android SDK中找不到gradle包装器。 Could not find Android SDK directory.
找不到Android SDK目录。 Might need to install Android SDK or set up 'ANDROID_HOME' env variable.
可能需要安装Android SDK或设置'ANDROID_HOME'env变量。
I also tried to install manually the SDK, without Android Studio, but it did not help. 我也尝试手动安装没有Android Studio的SDK,但没有帮助。 I am not used to working with CLI's so I may be missing something.
我不习惯使用CLI,所以我可能会缺少一些东西。
However, I tried upgrading Cordova, downgrading SDK and installing the latter manually. 但是,我尝试升级Cordova,降级SDK并手动安装后者。 I was also confused with environment variables, I tried some things I read but none worked.
我也对环境变量感到困惑,我尝试了一些我读过的东西,但没有任何效果。 Any help, appreciated.
任何帮助,不胜感激。
I figured it out. 我想到了。
Seems that in my case, Java JDK 9 was causing the problem. 就我而言,似乎是Java JDK 9引起了问题。 Downgrading to JDK 8 gave me the solution.
降级到JDK 8给了我解决方案。
In addition, I hadn't set the ANDROID_HOME variable correctly but even when I did, it did not work until downgrading to JDK 8. 另外,我没有正确设置ANDROID_HOME变量,但是即使我设置了变量,它也无法工作,直到降级到JDK 8。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.