I'm using Ubuntu 16.04, and I'm trying to build a Ionic 2 app using:
sudo cordova build android --release --nofetch
It brings me the error:
Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually. Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
If I use printenv ANDROID_HOME
it brings me /home/evolution6/Android/Sdk
same way: printenv PATH
brings
/home/evolution6/Android/Sdk/platform-tools
/home/evolution6/Android/Sdk/tools
My project settings are:
@ionic/cli: 3.16.0
cordova CLI: 7.1.0
Local packages:
@ionic/app-scripts: 3.0.1
Cordova Platforms: android 6.3.0
Ionic Framework: ionic-angular 2.2.0
System:
Android SDK: 26.1.1
Node: v6.11.5
npm: 3.10.10