0
votes

I built an APP using cordova with push notification plugin. I built it using PhoneGap, it successfully built and working for Android and IOS but i get an error on windows build...

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

PhoneGap Log:

    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 Build Error:

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

My 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" />

I have tried changing the versions but no luck... anyone have any idea why?

1

1 Answers

1
votes

I found a solution... The problem was PhoneGap only works with push notification 1.8.1

so changed my config.xml files like this

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