gpt4 book ai didi

ios - 使用 Cordova Push phonegap-plugin-push 1.8.0 的 PhoneGap Windows 构建失败

转载 作者:行者123 更新时间:2023-11-29 00:08:55 24 4
gpt4 key购买 nike

我使用带有推送通知插件的 cordova 构建了一个应用程序。我使用 PhoneGap 构建它,它成功构建并适用于 Android 和 IOS,但我在 Windows 构建时遇到错误...

版本PhoneGap(iOS/Android/Windows)cli-6.5.0 (4.3.1/6.1.2/4.4.3)

PhoneGap 日志:

    Build Date: 2017-11-08 00:12:04 +0000
--------------------------------------------------------------------------------
PLUGIN OUTPUT
--------------------------------------------------------------------------------
Fetching plugin "cordova-plugin-statusbar@~2.1.3" via npm
Installing "cordova-plugin-statusbar" at "2.1.3" for windows
"plugman.cmd install --platform windows --project /cygwin/project --plugin phonegap-plugin-push@~1.8.0 --var SENDER_ID=990801368143": Fetching plugin "phonegap-plugin-push@~1.8.0" via npm
Installing "phonegap-plugin-push" at "1.8.4" for windows
Updating appxmanifests with ToastCapable=true...
Failed to install 'phonegap-plugin-push': Error: Cannot find module 'C:\project\platforms\windows\cordova\lib\AppxManifest'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at module.exports (C:\project\cordova\plugins\phonegap-plugin-push\hooks\windows\setToastCapable.js:5:24)
at runScriptViaModuleLoader (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\pgb-cordova-lib\src\hooks\HooksRunner.js:189:18)
at runScript (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\pgb-cordova-lib\src\hooks\HooksRunner.js:165:16)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\pgb-cordova-lib\src\hooks\HooksRunner.js:133:20
at _fulfilled (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\q\q.js:816:30)
Cannot find module 'C:\project\platforms\windows\cordova\lib\AppxManifest'

PhoneGap 构建错误:

Error - Plugin error (you probably need to remove plugin files from your app): Fetching plugin "phonegap-plugin-push@~1.8.0" via npm Installing "phonegap-plugin-push" at "1.8.4" for windows Updating appxmanifests with ToastCapable=true... Failed to install 'phonegap-plugin-push': Error: Cannot find module 'C:\cygwin\tmp\gimlet\xxxxxxxx\project\platforms\windows\cordova\lib\AppxManifest' at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at module.exports (C:\cygwin\tmp\gimlet\xxxxxxxx\project\cordova\plugins\phonegap-plugin-push\hooks\windows\setToastCapable.js:5:24) at runScriptViaModuleLoader (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\pgb-cordova-lib\src\hooks\HooksRunner.js:189:18) at runScript (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\pgb-cordova-lib\src\hooks\HooksRunner.js:165:16) at C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\pgb-cordova-lib\src\hooks\HooksRunner.js:133:20 at _fulfilled (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\q\q.js:787:54) at self.promiseDispatch.done (C:\Users\Administrator\AppData\Roaming\npm\node_modules\pgb-plugman\node_modules\q\q.js:816:30) Cannot find module 'C:\cygwin\tmp\gimlet\2870062\project\platforms\windows\cordova\lib\AppxManifest' - You can fix this here

我的 config.xml:

<plugin name="cordova-plugin-statusbar" source="npm" spec="~2.1.3" />
<plugin name="phonegap-plugin-push" source="npm" spec="~1.8.0">
<variable name="SENDER_ID" value="my_firebase_id" />
</plugin>
<plugin name="cordova-plugin-battery-status" source="npm" spec="~1.1.1" />

我试过更改版本但没有成功...有人知道为什么吗?

最佳答案

我找到了解决方案...问题是 PhoneGap 仅适用于推送通知 1.8.1

所以像这样更改了我的 config.xml 文件

<plugin name="phonegap-plugin-push" source="npm" spec="1.8.1">
<variable name="SENDER_ID" value="my_firebase_id" />
</plugin>

关于ios - 使用 Cordova Push phonegap-plugin-push 1.8.0 的 PhoneGap Windows 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47169619/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com