I have have been trying to setup the environment to work with ionic and have follwed all the steps here
https://blog.nraboy.com/2014/09/install-android-cordova-ionic-framework-ubuntu/
after that i was getting the error for the android SDK so i installed it but still having the same error
[Error: Please install Android target: "android-21".
Hint: Open the SDK manager by running: /opt/android-sdk/tools/android
You will require:
1. "SDK Platform" for android-21
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)]
ERROR building one of the platforms: Error: /home/tasol/todo/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/tasol/todo/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)
You can see in the attached screenshot that all the packages are installed then also i am facing the same issue.
Can anyone please help me. Thanks in advance.
Using: Ubuntu 14.04
I have got rid of that error by following Tim's answer as i am a php developer and this is my first time with android sdk sorry if i sounds nube
The above error solved with the answer provided by Tim but now i am facing some new errors so updating the answer with them
ERROR : No emulator images (avds) found.
1. Download desired System Image by running: /opt/android-sdk/tools/android sdk
2. Create an AVD by running: /opt/android-sdk/tools/android avd
HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver
I have downloaded full package for 21 and now which image i should install and what is AVD its asking for
You seem to have installed all the packages for API 22, but you need API 21. Open up the SDK manager, install API 21 (5.0.1) and it should work
The above error solved with the answer provided by Tim but now i am facing some new errors so updating the answer with them
ERROR : No emulator images (avds) found. 1. Download desired System Image by running: /opt/android-sdk/tools/android sdk 2. Create an AVD by running: /opt/android-sdk/tools/android avd HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver
I have downloaded full package for 21 and now which image i should install and what is AVD its asking for
You already have the system images installed so that works
You can (and need to) created an AVD (android virtual device) to run your project on. To do this, open a terminal and type /opt/android-sdk/tools/android avd
and use the interface to create an AVD. After that it should work