peterc
peterc

Reputation: 7883

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..

enter image description here

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?

Upvotes: 52

Views: 54729

Answers (4)

Amirul Momenin
Amirul Momenin

Reputation: 1

cvd-gardle-config.json

{
  "MIN_SDK_VERSION": 29,
  "SDK_VERSION": 32,
  "COMPILE_SDK_VERSION": null,
  "GRADLE_VERSION": "7.4.2",
  "MIN_BUILD_TOOLS_VERSION": "29.0.2",
  "AGP_VERSION": "7.2.1",
  "KOTLIN_VERSION": "1.5.21",
  "ANDROIDX_APP_COMPAT_VERSION": "1.4.2",
  "ANDROIDX_WEBKIT_VERSION": "1.4.0",
  "ANDROIDX_CORE_SPLASHSCREEN_VERSION": "1.0.0-rc01",
  "GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION": "4.3.10",
  "IS_GRADLE_PLUGIN_GOOGLE_SERVICES_ENABLED": false,
  "IS_GRADLE_PLUGIN_KOTLIN_ENABLED": false
}

at MIN_BUILD_TOOLS_VERSION set your installed version at error you can see your installed version

Upvotes: 0

James Marshall
James Marshall

Reputation: 339

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).

Upvotes: 20

rahul rajeevan
rahul rajeevan

Reputation: 19

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 command cordova platform add [email protected]. Run the build code.

Upvotes: 1

peterc
peterc

Reputation: 7883

Today, I could finally install version 30.0.3.

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

enter image description 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.

Upvotes: 115

Related Questions