how to resolve this ERROR running one or more of the platform when i am runnning “ionic run android --device”

流过昼夜 提交于 2019-12-13 14:48:09

问题


$ 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?


回答1:


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


来源:https://stackoverflow.com/questions/44021244/how-to-resolve-this-error-running-one-or-more-of-the-platform-when-i-am-runnning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!