3
$ ionic run android --device
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\user\Desktop\transroads\jvdappNew\jvdApp\hooks\after_prepare\010_add_platform_class.js C:/Users/user/Desktop/transroads/jvdappNew/jvdApp
add to body class: platform-android
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.

It was working properly but when i updated my Android Studio there is installed another SDK also now i am having two SDK in the ANDROID_HOME path those are SDK and SDK1. SDK is having API23 and SDK1 API24. whenever i am running command "ionic run android --device" terminal always shows that error i have discuss above.

Before update of Android Studio everything was working properly but after the update i am unable to run ionic application on my mobile device.ANDROID_HOME path is C:\Users\user\AppData\Local\Android\sdk; and i am having SDK1 folder also after the Android Studios updation on that location.

AVD Manager.exe and SDK Manager.exe those files are only in SDK and SDK1 having nothing like that.Please help me out of this.

Anyone please tell me both the platform can run over a SDK Manager?

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
faizan
  • 61
  • 1
  • 2
  • what does `cordova requirements` command give? – Suraj Rao May 17 '17 at 09:47
  • $ cordova requirements 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: C:\Users\user\AppData\Local\Android\sdk\tools\templates\gradle\wrapper Error: Some of requirements check failed – faizan May 17 '17 at 10:26
  • hmm.. which is your cordova android platform version? – Suraj Rao May 17 '17 at 10:27
  • Cordova version is 6.0.0 – faizan May 17 '17 at 10:40
  • ok..adding an aswer – Suraj Rao May 17 '17 at 10:41
  • cordova android platform version? – Suraj Rao May 17 '17 at 10:44
  • cordova android platform version is 6.0.0 and i have tried your solution but it is not working it says platform already added. – faizan May 17 '17 at 10:53
  • remove the platform and add the new one – Suraj Rao May 17 '17 at 10:53
  • i have followed your instruction when i am running command ionic plateform add android@6.2.3 then there is a new error that is Error: cordovaProject.projectConfig.getFileResources is not a function – faizan May 17 '17 at 11:22
  • update cordova cli – Suraj Rao May 17 '17 at 11:24

1 Answers1

2

You need to update your cordova android platform. Basically the older version till 6.2.0 used android command which is deprecated in the SDK.This was patched in 6.2.0

Check this answer for more info.

Update your cordova cli first:

npm install -g cordova@latest

You can update to the latest platform by doing:

ionic platform add android@6.2.3

Or

ionic platform add android@latest

For IONIC CLI v3 the command is:

ionic cordova platform add android@latest
Community
  • 1
  • 1
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103