由于插件错误,Phonegap 无法构建
Phonegap fails to build due to plugin errors
我有一个应用程序,它总是通过 PhoneGap CLI 构建得很好。
我离开它几个星期,今天尝试重建(没有更改代码),但我遇到了很多错误。
Error - Plugin error (you probably need to remove plugin files from
your app): Fetching plugin "cordova-plugin-file-transfer@^1.6.3" via
npm Installing "cordova-plugin-file-transfer" at "1.7.0" for android
Failed to install 'cordova-plugin-file-transfer': CordovaError:
Version of installed plugin: "cordova-plugin-file@4.3.3" does not
satisfy dependency plugin requirement "cordova-plugin-file@^5.0.0".
Try --force to use installed plugin as dependency. at
/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/plugman/install.js:581:33
at _fulfilled
(/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:787:54)
at self.promiseDispatch.done
(/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch
(/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:749:13)
at
/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:509:49
at flush
(/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:67:7) at
process._tickCallback (internal/process/next_tick.js:98:9) Version of
installed plugin: "cordova-plugin-file@4.3.3" does not satisfy
dependency plugin requirement "cordova-plugin-file@^5.0.0". Try
--force to use installed plugin as dependency. - You can fix this here
"You can fix this here" 引导我到这里:
The most likely cause for this error is error is that you have
included plugin javascript files in your app package, such as
barcodescanner.js, GAPlugin.js, cdv-plugin-fb-connect.js, or any other
plugin files such as the childbrowser assets directory.
Previously we used pluginstall to install plugins, which would simply
overwrite files in your app. However we recently migrated to plugman,
which will not overwrite these files and instead fails. So make sure
you remove them! [my bold]
我不知道这是什么意思。当我需要这些插件时,为什么要删除插件文件?出于某种原因我是否需要重新安装我的所有插件,或者当一切正常时是否有某种方法可以恢复到以前的 PG 版本? (假设这是由于最近对 PG 工作方式的更改而发生的。)
如果有人能指出我远离这种严重头痛的正确方向,我将不胜感激!
好的,在对此进行大量挖掘之后,您似乎必须强制配置 XML 文件使用某些版本的插件。
这看起来很疯狂,因为在执行此操作时,如果您依赖的功能在一个插件版本中可用但在另一个版本中不可用,则您无法保证您的应用程序仍能正常工作。
尽管如此,this post 让我想到了这个:
<plugin name="cordova-plugin-camera" spec="~2.4.1" />
<plugin name="cordova-plugin-file" spec="~4.3.1" />
<plugin name="cordova-plugin-file-transfer" spec="~1.6.1" />
这确实让我的应用程序通过了构建过程,表面上看,经过最少的检查后,它似乎仍然可以工作,但它似乎仍然是一件非常可怕的事情。我把它留在这里以防它对任何人有帮助。
您需要删除 cordova 插件(如果使用 phonegap):
cordova plugin rm cordova-plugin-file-transfer
我有一个应用程序,它总是通过 PhoneGap CLI 构建得很好。
我离开它几个星期,今天尝试重建(没有更改代码),但我遇到了很多错误。
Error - Plugin error (you probably need to remove plugin files from your app): Fetching plugin "cordova-plugin-file-transfer@^1.6.3" via npm Installing "cordova-plugin-file-transfer" at "1.7.0" for android Failed to install 'cordova-plugin-file-transfer': CordovaError: Version of installed plugin: "cordova-plugin-file@4.3.3" does not satisfy dependency plugin requirement "cordova-plugin-file@^5.0.0". Try --force to use installed plugin as dependency. at /home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/plugman/install.js:581:33 at _fulfilled (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:787:54) at self.promiseDispatch.done (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:816:30) at Promise.promise.promiseDispatch (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:749:13) at /home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:509:49 at flush (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:108:17) at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickCallback (internal/process/next_tick.js:98:9) Version of installed plugin: "cordova-plugin-file@4.3.3" does not satisfy dependency plugin requirement "cordova-plugin-file@^5.0.0". Try --force to use installed plugin as dependency. - You can fix this here
"You can fix this here" 引导我到这里:
The most likely cause for this error is error is that you have included plugin javascript files in your app package, such as barcodescanner.js, GAPlugin.js, cdv-plugin-fb-connect.js, or any other plugin files such as the childbrowser assets directory.
Previously we used pluginstall to install plugins, which would simply overwrite files in your app. However we recently migrated to plugman, which will not overwrite these files and instead fails. So make sure you remove them! [my bold]
我不知道这是什么意思。当我需要这些插件时,为什么要删除插件文件?出于某种原因我是否需要重新安装我的所有插件,或者当一切正常时是否有某种方法可以恢复到以前的 PG 版本? (假设这是由于最近对 PG 工作方式的更改而发生的。)
如果有人能指出我远离这种严重头痛的正确方向,我将不胜感激!
好的,在对此进行大量挖掘之后,您似乎必须强制配置 XML 文件使用某些版本的插件。
这看起来很疯狂,因为在执行此操作时,如果您依赖的功能在一个插件版本中可用但在另一个版本中不可用,则您无法保证您的应用程序仍能正常工作。
尽管如此,this post 让我想到了这个:
<plugin name="cordova-plugin-camera" spec="~2.4.1" />
<plugin name="cordova-plugin-file" spec="~4.3.1" />
<plugin name="cordova-plugin-file-transfer" spec="~1.6.1" />
这确实让我的应用程序通过了构建过程,表面上看,经过最少的检查后,它似乎仍然可以工作,但它似乎仍然是一件非常可怕的事情。我把它留在这里以防它对任何人有帮助。
您需要删除 cordova 插件(如果使用 phonegap):
cordova plugin rm cordova-plugin-file-transfer