When I run ionic build android command in root of ionic project, I am getting this error:
FAILURE: Build failed with an exception.
This problem I solved with the following detail, somehow the android SDK manage installed all the dependencies and necessary files, but forget this `templates`
files where is found templates> gradle> wrapper. This set of files is missing.
Path in mac
/Users/giogio/Library/Android/sdk/tools/templates
Mac IOS
Edit ~/.bash_profile by using vi or other shell editor
vi ~/.bash_profile
Add the following lines:
export ANDROID_HOME=~/Library/Android/sdk
export PATH=${PATH}:~/Software/android-sdk-macosx/tools:~/Software/android-sdk-macosx/platform-tools"
(save the file, and exit) load those updated env variables to the current shell env:
. ~/.bash_profile
I fix the error by changing the ANDROID_HOME to C:\Users\Gebru\AppData\Local\Android\Sdk from wrong previous directory.
In my case the problem was that ANDROID_HOME was pointing to ~/Library/Android/
for some reason.
The correct path is ~/Library/Android/sdk
The solution for this question is here https://docops.ca.com/devtest-solutions/8-0-2/en/installing/setting-up-the-mobile-testing-environment/preinstallation-steps-for-mobile-testing/
Please follow this steps, and solve your problem.
The Android SDK package contains a component called compile tools. The mobile test requires at least version 19.0.1, 19.1.0 or 20.0.0.
If these versions are not installed with your ADT package, you may receive an error message when creating a mobile asset in the DevTest Workstation:
Please install the Android build tools version 19.1.0 or higher.
The following commands can update Android SDK on Ubuntu quickly and fix the above error:
android list sdk --all
android update sdk -u -a -t 19
android update sdk -u -a -t 20