简体   繁体   English

已安装 Ionic 构建工具但收到错误“未找到已安装的构建工具。安装 Android 构建工具版本 19.1.0 或更高版本。”

[英]Ionic build tools installed but receiving error "No installed build tools found. Install the Android build tools version 19.1.0 or higher."

I am trying to build and generate an apk for my Ionic 4 application.我正在尝试为我的 Ionic 4 应用程序构建和生成一个 apk。 When I attempt to do this, I am met with the following error:当我尝试这样做时,我遇到了以下错误:

A problem occurred evaluating project ':CordovaLib'.
[cordova]  > No installed build tools found. Install the Android build tools version 19.1.0 or higher.

I have looked at many other solutions on Stackoverflow for this problem and nothing has fixed my issue.对于这个问题,我在 Stackoverflow 上查看了许多其他解决方案,但没有任何解决方案可以解决我的问题。 I have the Android SDK and SDK tools installed through the Android Studio SDK manager.我通过 Android Studio SDK 管理器安装了 Android SDK 和 SDK 工具。

I have ANDROID_HOME set in both my .bash-profile and Android Studio path variables.我在 .bash-profile 和 Android Studio 路径变量中都设置了 ANDROID_HOME。 Here is what my .bash-profile file looks like, which is where I believe environmental variables are intended to be set?这是我的 .bash-profile 文件的样子,我认为这是要设置环境变量的地方?

export ANDROID_HOME=~/Users/zacharyjordan/Library/Android/sdk
export ANDROID_SDK_ROOT=~/Users/zacharyjordan/Library/Android/sdk

export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator

When I attempt to build my application, it doesn't even seem as if Ionic is detecting my updated ANDROID_HOME path.当我尝试构建我的应用程序时,Ionic 似乎甚至没有检测到我更新的 ANDROID_HOME 路径。 It lists ANDROID_HOME as ANDROID_HOME=/usr/local/Caskroom/android-sdk/4333796它将 ANDROID_HOME 列为 ANDROID_HOME=/usr/local/Caskroom/android-sdk/4333796

If anyone knows what I can do to get my app to build properly I would greatly appreciate it.如果有人知道我可以做些什么来使我的应用程序正确构建,我将不胜感激。 No other solutions on Stackoverflow have fixed my problem thus far.到目前为止,Stackoverflow 上没有其他解决方案可以解决我的问题。

I just troubleshooted this error on a coworker's computer and the problem was an environment variable called ANDROID_SDK_HOME that was set to a different folder ( C:\\Android in his case).我只是在同事的计算机上解决了这个错误,问题是一个名为ANDROID_SDK_HOME的环境变量被设置到不同的文件夹(在他的例子中是C:\\Android )。 Changing that variable to match the actual sdk folder fixed the issue.更改该变量以匹配实际 sdk 文件夹解决了该问题。

I have the Android SDK and SDK tools installed through the Android Studio SDK manager我通过 Android Studio SDK 管理器安装了 Android SDK 和 SDK 工具

SDK tools is different than the build tools . SDK tools不同于build tools

Go to SDK manager, download build tools v19.1.0 or higher then error should be gone.转到 SDK 管理器,下载构建工具v19.1.0或更高版本,然后错误应该消失了。

I managed to resolve my issue with the above error by creating 2 environment variables on my OSX machine for ANDROID_HOME this essentially is the same as what you did above but for my paths.我设法通过在我的 OSX 机器上为 ANDROID_HOME 创建 2 个环境变量来解决上述错误的问题,这与您在上面所做的基本相同,但对于我的路径。 (I had not done this prior.) (我之前没有这样做过。)

After that I ran the command sdkmanager "platform-tools" in my cordova projects CLI.之后,我在我的科尔多瓦项目 CLI 中运行了命令 sdkmanager“platform-tools”。 I had difficulties resolving this issue before using Android Studios SDK Manager but this method seemed to clear things up.在使用 Android Studios SDK Manager 之前我很难解决这个问题,但这种方法似乎可以解决问题。

Note: If build tools cannot be found for your project.注意:如果无法为您的项目找到构建工具。 It's worth trying sdkmanager "build-tools" in your CLI.值得在您的 CLI 中尝试 sdkmanager "build-tools"。

Hope this helps.希望这可以帮助。

我修好了

export ANDROID_HOME=~/Android/Sdk

First of all you get that because of your environment path is not correct.首先你得到的是因为你的环境路径不正确。

What worked for me (Windows 10):什么对我有用(Windows 10):

open Android Studio -> SDK Manager -> SDK Tools打开Android Studio -> SDK Manager -> SDK Tools

☐ Hide Obsolete Packages ☐ 隐藏过时的包

☑ Show Package Details ☑ 显示包裹详情

From Android SDK Build-Tools list来自Android SDK Build-Tools列表

☑ 29.0.3 ☑ 29.0.3

Set the PATH for the ANDROID_HOME to YOUR_PATH\\sdk将 ANDROID_HOME 的 PATH 设置为 YOUR_PATH\\sdk

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ionic cordova bulid android:未找到已安装的构建工具。 安装 Android 构建工具版本 19.1.0 或更高版本 - ionic cordova bulid android : No installed build tools found. Install the Android build tools version 19.1.0 or higher Ionic Aangular:未找到已安装的构建工具。 安装 Android 构建工具版本 19.1.0 或更高版本 - Ionic Aangular :No installed build tools found. Install the Android build tools version 19.1.0 or higher Cordova运行错误-找不到安装的生成工具。 安装Android构建工具版本19.1.0或更高版本 - Cordova run error - No installed build tools found. Install the Android build tools version 19.1.0 or higher 在 Visual Studio 中使用 ionic + Cordova 我不断收到“找不到已安装的构建工具。安装 Android 构建工具版本 19.1.0 或更高版本。” - Using ionic + Cordova in visual studio i keep getting "No installed build tools found. Install the Android build tools version 19.1.0 or higher." “Gradle 同步失败:未找到已安装的构建工具。安装 Android 构建工具版本 19.1.0 或更高版本” - "Gradle sync failed: No installed build tools found. Install the Android build tools version 19.1.0 or higher" 离子构建时间错误“未找到已安装的构建工具。安装 Android 构建工具版本 30.0.3 或更高版本” - Ionic build time error "No installed build tools found. Install the Android build tools version 30.0.3 or higher" 离子构建 Android | 错误:找不到已安装的构建工具。 请安装Android构建工具 - ionic build Android | error: No installed build tools found. Please install the Android build tools 未找到已安装的构建工具。 安装 Android 构建工具版本 30.0 - No installed build tools found. Install the Android build tools version 30.0 安装Android构建工具版本19.1.0 - Install the Android build tools version 19.1.0 构建工具错误“请安装Android构建工具版本19.1.0或更高版本” - Build tool error “Please install the Android build tools version 19.1.0 or higher”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM