简体   繁体   中英

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. Every time that I run ionic run android in the ionic CLI, I receive this error:

WARN: ionic.project has been renamed to ionic.config.json, please rename it. Using this version of Cordova with older version of cordova-android is deprecated. Upgrade to cordova-android@5.0.0 or newer.

Error: Your android platform does not have Api.js

For the moment I can not migrate to Ionic 2.

What can I do to run/build it?

Fist of all, when you install Ionic this way

npm install -g cordova ionic

You are getting the last CLI that works with Ionic 2 , Angular 2 and a different project structure . If you want to run and build an Ionic v1 project you need the tools that works with your version.

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 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. This question can help you to download and setup the android tools for this version of cordova.

After that you will be able to run ionic run android

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM