我正在使用Phonegap Build为Android
,iOS
和Windows
Phone构建应用程序。要发送通知,我正在使用 phonegap-plugin-push,但无法构建 apk。
在我的config.xml中,我把它添加到google-services.json
<platform name="android">
<resource-file src="google-services.json" target="google-services.json" />
</platform>
我从PhoneGap Build收到此错误,即使google-services.json位于config旁边的根文件夹中.xml
任务":p rocessDebugGoogleServices"的执行失败。
文件google-services.json丢失。谷歌服务插件 没有它就无法运行。
搜索位置:
/project/src/debug/google-services.json/project/google-services.json
我仍然不明白为什么它不应该工作,因为它正是被要求做的。 提前感谢任何帮助。
附加信息 :
我在推送插件 (2.0.0( 旁边使用 phonegap cli-7.1.0 和其他 cordova 插件,这是列表:
<plugin name="cordova-plugin-device" spec="1.1.6" source="npm" />
<plugin name="cordova-plugin-splashscreen" spec="4.0.3" source="npm" />
<plugin name="cordova-plugin-network-information" spec="1.3.3" source="npm" />
<plugin name="cordova-plugin-inappbrowser" spec="1.7.1" source="npm" />
<plugin name="cordova-plugin-statusbar" spec="2.2.3" source="npm" />
<plugin name="cordova-plugin-whitelist" spec="1.3.2" source="npm" />
<plugin name="cordova-plugin-screen-orientation" spec="2.0.1" source="npm" />
编辑
这似乎是我正在使用的PhoneGap构建(PGB(版本的问题。推送插件的 2.0.0 版本应该使用新的 PGB 构建器构建。https://blog.phonegap.com/phonegap-7-0-1-now-on-build-and-it-includes-some-important-changes-89087fe465f5
对于Phonegap Build Cli 8.0.0及更高版本,目标路径略有不同(低于app/
(:
<platform name="android">
<resource-file src="google-services.json" target="app/google-services.json" />
</platform>
正如我在问题的编辑部分所说,它与 PGB 的构建器版本有关。
添加到我的配置后.xml<preference name='pgb-builder-version' value='2' />
,找到了google-services.json(我仍然收到错误,但它不再与此文件相关(