Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic-box vagrant box - Install Android target: "android-22"

I'm using the latest ionic-box as of 27th April 2015. I've been able to ionic platform add android but getting the following error when ionic build android:

[Error: Please install Android target: "android-22".
Hint: Open the SDK manager by running: /home/vagrant/android-sdk-linux/tools/android 

You will require:  
1. "SDK Platform" for android-22  
2. "Android SDK Platform-tools (latest)  
3. "Android SDK Build-tools" (latest)]  

I've tried updating the sdk with the following command

android update sdk --no-ui

where I get the output of fetching a number of "https://dl-ssl.google.com/android*" File not found. However, if i copy that url and paste it on a browser the file is there.

My vagrant box is now bridged on the network to have direct access to the internet, since NAT was giving me the same errors.

Any help is much appreciated.

like image 464
Rodrigo Rubio Avatar asked Apr 28 '15 01:04

Rodrigo Rubio


3 Answers

Follow these steps.
1) Type android on command line.(Make sure ANDROID_HOME and PATH are set properly)
2) Select API 22 from the populated list.
3) Click install packages.
4) Type android avd on command line.
5) Set API level and other config.
6) Now type ionic build android.

like image 101
Shamsher Avatar answered Nov 18 '22 08:11

Shamsher


i work around this by changing https to http or vise versa, in options but as a quick fix for supporting andorid API 21 like @astroanu commented this will help. it will add the support of API 21 in project.

$ cordova platforms remove android
$ cordova platforms add [email protected]
like image 24
Abdul Hameed Avatar answered Nov 18 '22 08:11

Abdul Hameed


I was able to build an android apk by doing the following:

  1. Open up the SDK manager after downloading/installing the android SDK (android studio). AndroidStuido>Appearance&Behavior>System Settings>Android SKD. Alternatively, you can just click on the "SDK Manager" button on the "Welcome to Android Studio" window that appears when you open Android Studio.
  2. Under SDK Platforms, click on Android 5.1.1 - API Level 22 and hit apply to install the package.
like image 2
Nick Brady Avatar answered Nov 18 '22 10:11

Nick Brady