After reseting plugins, Ionic 2 program doesn't work?

我怕爱的太早我们不能终老 提交于 2019-12-12 09:19:08

问题


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.

I've used Beacon Plugin in my project.

----edit----

What it doesn't work is Cannot read property 'Delegate' of undefined in var delegate = new this.locationManager.Delegate();

----edit----

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

----edit----

After ionic platform rm android and ionic platform add android, still doesn't works.

----edit----

Doesn't work even I reinstall the Cordova.


回答1:


The command

ionic state reset --plugins

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

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

And Ionic will add in the appropriate plugins and platforms.



来源:https://stackoverflow.com/questions/37679723/after-reseting-plugins-ionic-2-program-doesnt-work

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