无法将推送通知插件添加到 cordova

Posted

技术标签:

【中文标题】无法将推送通知插件添加到 cordova【英文标题】:Failed to add Push Notification Plugin into cordova 【发布时间】:2014-04-30 15:26:07 【问题描述】:

我刚刚创建了一个测试 cordova 项目,现在正尝试将一个简单的推送通知插件 (https://github.com/phonegap-build/PushPlugin) 添加到我的项目中。

我按照它的指示输入了这个:

cordova plugin add https://github.com/phonegap-build/PushPlugin.git

但立即,命令行失败并显示以下错误消息:

F:\Workplace\pushnotification\pushnotification>cordova plugin add https://github.com/phonegap-build/PushPlugin.git
Fetching plugin "https://github.com/phonegap-build/PushPlugin.git" via git clone
Error: Command failed: fatal: could not create work tree dir 'C:\Users\FRANV_~1\AppData\Local\Temp\plugman\git\1398870928641'.: No such file or directory

    at ChildProcess.exithandler (child_process.js:637:15)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Socket.<anonymous> (child_process.js:956:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:465:12)

我刚刚更新了我的 Tortoise GitHub,但并没有解决问题。

【问题讨论】:

【参考方案1】:

Windows 上的 git 源依赖项似乎存在错误。

尝试手动创建目录:

mkdir C:\Users\FRANV_~1\AppData\Local\Temp\plugman\git\1398870928641

然后:

cordova plugin add https://github.com/phonegap-build/PushPlugin.git

【讨论】:

嗨罗宾,谢谢。现在可以了。我只是不喜欢 git 错误。我如何通知他们解决这个问题?(我也想知道 git 团队怎么会犯这个明显的错误(对不起,如果这是一个错误/错误)。 此问题已在 Scale 存储库中打开,但尚未解决。 github.com/sbt/sbt/issues/895 嗨罗宾,你能提供问题(跟踪)网址/链接吗? @RobinCominotto 当我尝试运行命令时它不起作用它总是生成新的目录名称还有其他解决方案吗?

以上是关于无法将推送通知插件添加到 cordova的主要内容,如果未能解决你的问题,请参考以下文章

科尔多瓦推送通知插件抛出错误

将 Parse 推送通知与 Phonegap 集成

无法为推送通知注册设备 (iOS8)

使用 PhoneGap 管理推送通知的平台

由于应用程序/无效凭据错误,无法发送设备推送通知

使用PhoneGap插件点击推送通知时无法打开应用程序?