Ionic 3 - Android build - Android SDK


#1

Hi everybody! When I try to build a new app (ionic 3) for android, the terminal shows this error:

Error: Failed to find ‘ANDROID_HOME’ environment variable. Try setting setting it manually.
Detected ‘adb’ command at /usr/local/Cellar/android-sdk/24.4.1_1/bin but no ‘platform-tools’ directory found near.
Try reinstall Android SDK or update your PATH to include valid path to SDK/platform-tools directory.

I changed many times the ANDROID_HOME path (with all the posibilities) and nothings happens, anyone have the same problem?
Thanks!!

Regards
Armando


#2

if you’re on linux

set this in ~/.profile file

export ANDROID_HOME=~/path/to/android-sdk-linux/


#3

Hi ! Im not use Linux, Im on Mac OSX


#4

MAC OS SIERRA,
Hi everybody! , I have the same error :frowning: :frowning:

global packages:

@ionic/cli-utils : 1.2.0
Cordova CLI      : 6.5.0
Ionic CLI        : 3.2.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.2.1
@ionic/cli-plugin-ionic-angular : 1.2.0
Cordova Platforms               : android 6.2.3 ios 4.4.0
Ionic Framework                 : ionic-angular 3.0.1

System:

Node       : v6.9.4
OS         : macOS Sierra
Xcode      : Xcode 8.2.1 Build version 8C1002
ios-deploy : 1.9.0
ios-sim    : 5.0.13

cordova run android
Error: Failed to find ‘ANDROID_HOME’ environment variable. Try setting setting it manually.
Detected ‘adb’ command at /usr/local/Cellar/android-platform-tools/25/bin but no ‘platform-tools’ directory f
ound near.
Try reinstall Android SDK or update your PATH to include valid path to SDK/platform-tools directory.

[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova run android (exit code 1).


#5

The same should work on macos too