Programmers learn & share
0 votes

Problem :

I am trying to learn the Android and Ionic. If I run the ionic build android command in the root of the ionic project, I am facing below error:

FAILURE: Build failed with an exception.
•Where: Script '/home/javad/Desktop/javadApp/platforms/android/CordovaLib/cordova.gradle' line: 64
•What went wrong: A problem occurred evaluating root project 'android'.
No installed build tools found. Please install the Android build tools version 19.1.0 or higher.
•Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


by (2.3k points)   | 325 views

1 Answer

0 votes

Solution :

I was going through some of the interesting questions on this forum and I came across your question.

It is very common error for the programmers who are new to Android and Ionic.

I guess you might have forgotten to set the class paths properly.

Please set the paths as shown below they are same for Ubantu and Mac

export ANDROID_HOME=/Users/mphil/Software/android-sdk-macosx

export PATH=${PATH}:/Users/mphil/Software/android-sdk-macosx/tools

export PATH=${PATH}:/Users/mphil/Software/android-sdk-macosx/platform-tools

After setting up the environment variables you must reload the environment variables using below commands

//For your ubuntu

$source .bashrc

//For your macos

$source .bash_profile

Now you can check in your terminal using below commands

$printenv ANDROID_HOME

$printenv PATH

If  you do not see your changes in printenv then try to restart your pc and run above commands again.

Now open the terminal and write $and and try to hit the tab if you see the complete $android then your installation is properly done.

Now you will not face above error.

by (4.7k points)  
2,218 questions
2,683 answers
241 users