Cordova doesn’t find “build tools” for Android platform. But it’s installed.
I don’t understand what is wrong. I read a lot of posts on this kind of issues but without result.
When I try to build cordova app I have this error:
$ cordova build android
Checking Java JDK and Android SDK versions
ANDROID_HOME=undefined (recommended setting)
ANDROID_SDK_ROOT=/Users/joseph.adam/Library/Android/sdk (DEPRECATED)
Using Android SDK: /usr/local/Caskroom/android-platform-tools/35.0.1
BUILD SUCCESSFUL in 989ms
1 actionable task: 1 up-to-date
Subproject Path: CordovaLibSubproject Path: app
FAILURE: Build failed with an exception.
* Where:Script '/Users/joseph.adam/Documents/works/stellantis/tablets-app/hello/platforms/android/CordovaLib/cordova.gradle' line: 73
* What went wrong:
A problem occurred evaluating script.
> No installed build tools found. Please install the Android build tools version 34.0.0.
2 questions :
-
Why ANDROID_HOME is undefined ?
-
Why cordova use /usr/local/Caskroom/android-platform-tools/35.0.1 and not /Users/joseph.adam/Library/Android/sdk ?
I’m on Mac Sonoma 14.5
$ cordova -v => 12.0.0 ([email protected])
I have a fresh install of Android Studio. In the “Tools” menu:
There is only SDK version 14 installed (hiding or not obsolete packages) into Android Studio.
The path: /Users/joseph.adam/Library/Android/sdk
I use ZSH ( $ echo $SHELL => /bin/zsh )
Files ~/.bash_profile and ~/.zshrc contain :
export ANDROID_HOME=~/Library/Android/sdk
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/build-tools:$PATH
export PATH=$ANDROID_HOME/build-tools/34.0.0:$PATH
export PATH=$ANDROID_HOME/platforms:$PATH
I try $ source ~/.bash_profile and $ source ~/.zshrc
Build Tools is present: /Users/joseph.adam/Library/Android/sdk/build-tools/34.0.0
No suggestion during StackOverflow review works.
What’s wrong ?
Tell me if I forgot something to show.
Thank You.