使用 PhoneGap Build,它说 'google-services.json is missing' 但它不是
Using PhoneGap Build, it says 'google-services.json is missing' but it's not
我正在使用 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>
即使 google-services.json 在 config.xml[=40= 旁边的根文件夹中,我还是从 PhoneGap Build 中收到此错误]
Execution failed for task ':processDebugGoogleServices'.
File google-services.json is missing. The Google Services Plugin
cannot function without it.
Searched Location:
/project/src/debug/google-services.json
/project/google-services.json
我仍然不明白为什么它不工作,而它应该工作,因为它正是要求做的事情。在此先感谢您的帮助。
附加信息:
除了 push-plugin (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 Build (PGB) 版本的问题。推送插件的 2.0.0 版应该使用新的 PGB 构建器构建。 https://blog.phonegap.com/phonegap-7-0-1-now-on-build-and-it-includes-some-important-changes-89087fe465f5
正如我在问题的 EDIT 部分所述,它与 PGB 的构建器版本有关。
添加到我的config.xml<preference name='pgb-builder-version' value='2' />
后,发现google-services.json(我仍然得到一个错误,但它不再与这个文件相关)
对于 Phonegap Build Cli 8.0.0 及更高版本,目标路径有点不同(在 app/
下):
<platform name="android">
<resource-file src="google-services.json" target="app/google-services.json" />
</platform>
我正在使用 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>
即使 google-services.json 在 config.xml[=40= 旁边的根文件夹中,我还是从 PhoneGap Build 中收到此错误]
Execution failed for task ':processDebugGoogleServices'.
File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
/project/src/debug/google-services.json
/project/google-services.json
我仍然不明白为什么它不工作,而它应该工作,因为它正是要求做的事情。在此先感谢您的帮助。
附加信息:
除了 push-plugin (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 Build (PGB) 版本的问题。推送插件的 2.0.0 版应该使用新的 PGB 构建器构建。 https://blog.phonegap.com/phonegap-7-0-1-now-on-build-and-it-includes-some-important-changes-89087fe465f5
正如我在问题的 EDIT 部分所述,它与 PGB 的构建器版本有关。
添加到我的config.xml<preference name='pgb-builder-version' value='2' />
后,发现google-services.json(我仍然得到一个错误,但它不再与这个文件相关)
对于 Phonegap Build Cli 8.0.0 及更高版本,目标路径有点不同(在 app/
下):
<platform name="android">
<resource-file src="google-services.json" target="app/google-services.json" />
</platform>