简体   繁体   English

两个cordova-plugin-device插件

[英]Two cordova-plugin-device plugins

I have just added the cordova plugin com.phonegap.plugin.mobile-accessibility to my ionic project, and it had automatically installed cordova-plugin-device as it is its dependency. 我刚刚在我的离子项目中添加了cordova插件com.phonegap.plugin.mobile-accessibility ,它已经自动安装了cordova-plugin-device因为它是它的依赖项。

This would be fine, but I already have the plugin installed (as a dependancy of another plugin) under a different name ( org.apache.cordova.device ). 可以,但是我已经以不同的名称( org.apache.cordova.device )安装了该插件(作为其他插件的依赖项)。 Has anyone got any ideas on whether I should keep both, or how I could remove one. 有没有人对我是否应该同时保留这两个或如何删除它们有任何想法。

I think that having both of these plugins is causing the following error and stopping me from building the App. 我认为同时拥有这两个插件会导致以下错误,并导致我无法构建该应用程序。

[INFO:CONSOLE(59)] "Uncaught module cordova-plugin-device.device not found", source: file:///android_asset/www/cordova.js (59)

I have screen dumped the dependency errors I get when trying to uninstall one of the plugins. 屏幕上已转储我尝试卸载其中一个插件时遇到的依赖项错误。

在此处输入图片说明

Easy enough fix, I removed the android platform and then re-added it again. 足够简单的修复程序,我删除了android平台,然后重新添加了它。 As it went through the install it skipped the second cordova-plugin-device plugin install so now the platform only has it once. 在安装过程中,它跳过了第二次cordova-plugin-device插件安装,因此现在该平台只安装了一次。

The App now builds and works as it should. 该应用程序现在可以构建并正常运行。

Answer was found here - http://forum.ionicframework.com/t/plugins-does-not-exist/2980/5 在这里找到答案-http://forum.ionicframework.com/t/plugins-does-not-exist/2980/5

NOTE: did not need to remove and add ionic & Cordova, only the Android and iOS platforms 注意:不需要删除和添加ionic&Cordova,仅需要Android和iOS平台

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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