0

I'm using ionic2 and when I run app as ionic cordova run android. I got this

error: ERROR running one or more of the platforms: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable. You may not have the required environment or OS to run this project

although I have android studio and SDK installed and set it in bashrc file as:

export ANDROID_HOME="/home/shimaa/Android/Sdk"
export PATH=${PATH}:/home/shimaa/Android/Sdk/platform-tools:/Development/android-sdk/tools
export PATH=${PATH}:/home/shimaa/android-studio/gradle/gradle-3.2/bin

but when I write android or sdkmanager in terminal I got this error:

No command 'android' found and sdkmanager: command not found

which means that android is not installed although it is installed and I run it. anyone can tell me the solution ?

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Al-shimaa Adel
  • 767
  • 1
  • 10
  • 26
  • what is the output for `cordova requirements` command in your project folder. Also which version of cordova-android platform are you using? – Suraj Rao Jul 29 '17 at 08:18
  • @suraj this is the output: Requirements check results for android: Java JDK: installed . Android SDK: installed Android target: not installed Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable. Gradle: not installed Could not find gradle wrapper within Android SDK. Might need to update your Android SDK. Looked here: /home/shimaa/Android/Sdk/tools/templates/gradle/wrapper Requirements check results for ios: Apple OS X: not installed – Al-shimaa Adel Jul 29 '17 at 08:20
  • what is the `cordova-android` version? it is shown in platforms.json in platforms folder – Suraj Rao Jul 29 '17 at 08:21
  • @suraj: Installed platforms: android 5.1.1, ios 4.0.1 Available platforms: amazon-fireos, blackberry10, browser, firefoxos, ubuntu, webos – Al-shimaa Adel Jul 29 '17 at 08:24
  • platforms.json in platforms folder – Suraj Rao Jul 29 '17 at 08:24
  • @suraj "ios": "4.0.1", "android": "5.1.1" – Al-shimaa Adel Jul 29 '17 at 08:27
  • ok.. check [my answer here](https://stackoverflow.com/questions/43676836/how-to-setup-environmental-variable-for-android-in-mac/43677221#43677221). I believe it is the same problem – Suraj Rao Jul 29 '17 at 08:27
  • @suraj: sorry but I always have this error when I run ionic cordova platform add android@latest --save the error is [ERROR] Cordova encountered an error. You may get more insight by running the Cordova command above directly. – Al-shimaa Adel Jul 29 '17 at 08:35
  • what error do you get when you run `cordova platform add android@latest`? – Suraj Rao Jul 29 '17 at 08:36
  • @suraj ✖ Running command - failed! [ERROR] Cordova encountered an error. You may get more insight by running the Cordova command above directly. [ERROR] An error occurred while running cordova platform add android@latest --save (exit code 1): Error: Platform android already added. and it not solve the problem – Al-shimaa Adel Jul 29 '17 at 08:38

0 Answers0