On linux
First of all, set ANDROID_HOME to the .bashrc file
Run command
sudo gedit ~/.bashrc
set the andoid sdk path where you installed
export ANDROID_HOME=/opt/android-sdk-linux export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
to reload the file launch command
source ~/.bashrc
Now check the installed platform, run the command
ionic platform
Exit
Installed platforms: android 6.0.0 Available platforms: amazon-fireos ~3.6.3 (deprecated) blackberry10 ~3.8.0 browser ~4.1.0 firefoxos ~3.6.3 ubuntu ~4.3.4 webos ~3.7.0
if android is already installed, you must uninstall and install again and again
ionic platform rm android ionic platform add android
If you havenβt already installed, add the Android platform
ionic platform add android
Please make sure you add the Android platform without the sudo command
if you still get error when adding android platfrom as below
Error: EACCES: permission denied, open '/home/ubuntu/.cordova/lib/npm_cache/cordova-android/6.0.0/package/package.json'
Please go to / home / ubuntu / and delete the .cordova folder from there
cd /home/ubuntu/ sudo rm -r .cordova
Now run the following command again
ionic platform add android
after successfully adding the platform, you will be able to build andoid in ionic form.
thank
Dineshaws Dec 14 '16 at 8:16 2016-12-14 08:16
source share