3

I am trying to build and generate an apk for my Ionic 4 application. 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. I have the Android SDK and SDK tools installed through the Android Studio SDK manager.

I have ANDROID_HOME set in both my .bash-profile and Android Studio path variables. Here is what my .bash-profile file looks like, which is where I believe environmental variables are intended to be set?

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. It lists ANDROID_HOME as 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.

1

5 Answers 5

1

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). Changing that variable to match the actual sdk folder fixed the issue.

Sign up to request clarification or add additional context in comments.

Comments

1

First of all you get that because of your environment path is not correct.

What worked for me (Windows 10):

open Android Studio -> SDK Manager -> SDK Tools

☐ Hide Obsolete Packages

☑ Show Package Details

From Android SDK Build-Tools list

☑ 29.0.3

Set the PATH for the ANDROID_HOME to YOUR_PATH\sdk

Comments

0

I have the Android SDK and SDK tools installed through the Android Studio SDK manager

SDK tools is different than the build tools.

Go to SDK manager, download build tools v19.1.0 or higher then error should be gone.

3 Comments

Thanks for your response. I have Android SDK Build-Tools installed and the issue is persisting.
pls boss im dying of thirst
This might be duplicate which you should check this answer; stackoverflow.com/a/38659163/4409113
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. (I had not done this prior.)

After that I ran the command sdkmanager "platform-tools" in my cordova projects CLI. I had difficulties resolving this issue before using Android Studios SDK Manager but this method seemed to clear things up.

Note: If build tools cannot be found for your project. It's worth trying sdkmanager "build-tools" in your CLI.

Hope this helps.

Comments

0

I fixed it by

export ANDROID_HOME=~/Android/Sdk

2 Comments

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review
@Ritesh this is how I solved the same mroblem. Just sharing a possible solution.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.