如何解决这个运行一个或多个平台的错误,当我运行“ionic run android --device” [英] how to resolve this ERROR running one or more of the platform when i am runnning "ionic run android --device"

查看:274
本文介绍了如何解决这个运行一个或多个平台的错误,当我运行“ionic run android --device”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  $ ionic run android --device 
运行命令:C:\ Program Files \\\
odejs\\\
ode.exeC:\ Users \ user \Desktop\transroads\jvdappNew\jvdApp\hooks\after_prepare\010_add_platform_class.js C:/ Users / user / Desktop / transroads / jvdappNew / jvdApp
添加到body类:platform-android $运行一个或多个平台的b $ b错误:未找到Android SDK。确保它已安装。如果它不在默认位置,请设置ANDROID_HOME环境变量。
您可能没有所需的环境或操作系统来运行此项目。

它工作正常,但是当我更新我的Android Studio时,现在又安装了另一个SDK在ANDROID_HOME路径中的两个SDK是SDK和SDK1。 SDK有API23和SDK1 API24。
当我运行命令ionic run android --device终端总是显示我上面讨论过的错误。



在更新Android Studio之前,一切正常正确,但更新后,我无法在我的移动设备上运行离子应用程序.ANDROID_HOME路径是C:\ Users \\\\ Application \ Local \Android\sdk;并且在Android Studios更新之后,该SDK1文件夹也在该位置。



AVD Manager.exe和SDK Manager.exe这些文件仅在SDK和SDK1中没有任何内容请帮我解决这个问题



任何人都可以告诉我这个平台可以运行在SDK Manager上吗?

解决方案

您需要更新您的cordova android平台。基本上,直到6.2.0的旧版本使用了 android 命令,这个命令在SDK中已被弃用。这是在6.2.0中修补的



查看此答案以获取更多信息。



更新您的cordova cli首先:

  npm install -g cordova @ latest 

您可以通过以下方式更新到最新平台:

 离子平台添加android@6.2.3 

或者

< pre $ 离子平台添加android @ latest

IONIC CLI v3 命令是:

 离线cordova平台添加android @ latest 


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

解决方案

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

这篇关于如何解决这个运行一个或多个平台的错误,当我运行“ionic run android --device”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆