Why can't cordova find the android build tools

36 Views Asked by At

I am attempting to create an android app with Cordova. I have previously installed IntelliJ IDE, which created an Android directory in my home folder. Inside, there is an Sdk folder, containing build-tools, licenses, platform-tools, platforms, and sources. My Cordova project is in Documents/Android. I have added android as a platform, but when I run cordova emulate android, it says No installed build tools found. Please install the Android build tools version 33.0.2. I have the correct build tools in my Android SDK directory, and it is in my $PATH. I am on a raspberry pi running Ubuntu, so I can't install Android Studio (I tried!). I have tried moving the build tools around my home folder, updating gradle, downgrading it, removing build-tools, reinstalling it, and upgrading Cordova.The full output is:

Checking Java JDK and Android SDK versions
ANDROID_HOME=/home/arco/Android/Sdk (recommended setting)
ANDROID_SDK_ROOT=/home/arco/Android/Sdk (DEPRECATED)
Using Android SDK: /home/arco/Android/Sdk
Subproject Path: CordovaLib
Subproject Path: app
openjdk version "11.0.22" 2024-01-16
OpenJDK Runtime Environment (build 11.0.22+7-post-Ubuntu-0ubuntu223.10.1)
OpenJDK 64-Bit Server VM (build 11.0.22+7-post-Ubuntu-0ubuntu223.10.1, mixed mode)

FAILURE: Build failed with an exception.

* Where:
Script '/home/arco/Documents/Android/hello/platforms/android/CordovaLib/cordova.gradle' line: 69

* What went wrong:
A problem occurred evaluating script.
> No installed build tools found. Please install the Android build tools version 33.0.2.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1s
Command failed with exit code 1: /home/arco/Documents/Android/hello/platforms/android/gradlew -b /home/arco/Documents/Android/hello/platforms/android/build.gradle cdvBuildDebug
0

There are 0 best solutions below