[英]How to run an ionic v1 app on Android?
I just received an ionic v1 app that I have to make some changes,but after a fresh installation of ionic, I'm unable to run it. 我刚收到一个ionic v1应用程序,需要进行一些更改,但是在重新安装ionic之后,我无法运行它。 Every time that I run ionic run android
in the ionic CLI, I receive this error: 每次我在ionic CLI中运行ionic run android
时,都会收到此错误:
WARN: ionic.project has been renamed to ionic.config.json, please rename it. 警告:ionic.project已重命名为ionic.config.json,请重命名。 Using this version of Cordova with older version of cordova-android is deprecated. 不建议将此版本的Cordova与较旧的cordova-android一起使用。 Upgrade to cordova-android@5.0.0 or newer. 升级到cordova-android@5.0.0或更高版本。
Error: Your android platform does not have Api.js 错误:您的Android平台没有Api.js
For the moment I can not migrate to Ionic 2. 目前,我无法迁移到Ionic 2。
What can I do to run/build it? 我该怎么做才能运行/构建它?
Fist of all, when you install Ionic this way 以这种方式安装Ionic时,所有的拳头
npm install -g cordova ionic npm install -g cordova ionic
You are getting the last CLI that works with Ionic 2 , Angular 2 and a different project structure . 您将获得与Ionic 2 , Angular 2和其他项目结构一起使用的最后一个CLI。 If you want to run and build an Ionic v1 project you need the tools that works with your version. 如果要运行和构建Ionic v1项目,则需要适用于您的版本的工具。
To install a specific version you need to add @ symbol after the name package and the version that you want for example: 要安装特定版本,您需要在名称包和所需的版本之后添加@符号,例如:
npm install -g ionic@1.7.14 npm install -g ionic@1.7.14
npm install -g cordova@6.0.0 npm install -g cordova@6.0.0
Also you have to keep in mind that Android has been improving their tools too, and this version of cordova doesn't work properly with the latest Android tools chain. 另外,您还必须牢记,Android也在不断改进其工具,并且此版本的cordova不能与最新的Android工具链一起正常使用。 This question can help you to download and setup the android tools for this version of cordova. 这个问题可以帮助您下载和设置此版本的cordova的android工具。
After that you will be able to run ionic run android
之后,您将可以运行ionic run android
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.