重置插件后,Ionic 2 程序不起作用? [英] After reseting plugins, Ionic 2 program doesn't work?

查看:24
本文介绍了重置插件后,Ionic 2 程序不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ionic 2 项目中使用了许多插件.之前一切正常.但是在启动ionic state reset --plugins之后,有些对象就找不到了.

I used many plugins in my Ionic 2 project. All things works fine before. But after launching ionic state reset --plugins, some objects cannot be found any more.

我在我的项目中使用了 Beacon 插件.

I've used Beacon Plugin in my project.

----编辑----

它不起作用的是无法读取 var delegate = new this.locationManager.Delegate();

----编辑----

最奇怪的是 ionic serve 工作(浏览器),但 ionic run android(设备)不工作.

The most weird thing is that ionic serve works (Browser), but ionic run android (Device) doesn't.

----编辑----

ionic platform rm androidionic platform add android后,还是不行.

----编辑----

即使我重新安装 Cordova 也无法正常工作.

Doesn't work even I reinstall the Cordova.

推荐答案

命令

ionic state reset --plugins

删除所有内容,然后恢复您在 package.json 文件中指定的内容.您项目的 package.json 文件中是否引用了 Beacon 插件?如果没有,您将不得不运行

removes everything and then bring back what you have specified in the package.json file. Is the Beacon Plugin reference in your project's package.json file? If not, you will have to run

ionic plugin add https://github.com/petermetz/cordova-plugin-ibeacon.git

再次添加.一切正常后,您可以运行以下命令以将当前插件/平台保存到 package.json:

to add it again. Once everything is working again, you can run the following command in order to save current plugins / platforms to the package.json:

ionic state save

然后,如果您需要快速加载插件和平台,您可以这样做:

And then, if you need to quickly load in plugins and platforms, you can simply do:

ionic state restore

Ionic 会添加适当的插件和平台.

And Ionic will add in the appropriate plugins and platforms.

这篇关于重置插件后,Ionic 2 程序不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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