简体   繁体   中英

Ionic Cordova Android: No usable Android build tools found. Highest 30.x installed version is 30.0.2; minimum version required is 30.0.3

I have updated Cordova Android to the latest (10.1.1) and now when I build I get:

No usable Android build tools found. Highest 30.x installed version is 30.0.2; minimum version required is 30.0.3

I have the following reported when I start the build:

Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\peter\AppData\Local\Android\sdk (recommended setting)
ANDROID_HOME=undefined (DEPRECATED)
Using Android SDK: C:\Users\peter\AppData\Local\Android\sdk

I also have the folder C:\Users\peter\.android an C:\Users\peter\.gradle

I upgraded Android Studio,dowloaded SDK's etc, and started a new project after reading elsewhere this may update the build tools. This did make a difference, as originally the error reported installed version was 29.0.2 and now it is 30.0.2, but something is looking for 30.0.3 .

The version 30.0.3 is coming from the file platforms\android\cdv-gradle-config.json , and I have the following folders in `C:\Users\peter\AppData\Local\Android\sdk\build-tools..

在此处输入图像描述

I cannot see how to get 30.0.3 , when I look at https://developer.android.com/studio/releases/build-tools#groovy I don't see this version

Why might this config have this version, or where I can get this version of the build tools?

Today, I could finally install version 30.0.3.

In Android Studio, I could see and install it from here...

在此处输入图像描述

After this, and then also having to remove the whitelist plugin (it is not required any more), I could get it to build.

Only hassle now is it outs to a .aab and not an .apk so side load testing now harder. But the main issue, the building is now working (on Windows PC).. Now hopefully can do the same on the Mac.

it is due to the android platform version.run the code 'ionic info'to find the version.if it is 10.1.1,remove it by running the code 'ionic cordova platform rm android' and install the version 8.0.0 by the code'cordova platform add android@8.0.0'.And run the build code

Possibly of use to people reading this--

This is answered in this GitHub issue . In short, major version upgrades of the build tools are likely to break Cordova, so the latest Cordova only supports build tools version 30.0.3. The error message asking for "30.0.3 or higher" is misleading, and was an oversight and will be changed. Currently, 30.0.3 is the only version that works here and that Android Studio will install from the "SDK Tools" tab.

Solution: Install version 30.0.3, and it should work (it works for me).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM