【问题标题】:Cordova: Problems with GoogleService-info.plistCordova:GoogleService-info.plist 的问题
【发布时间】:2018-01-29 12:45:54
【问题描述】:

目前,我正在开发一个应用程序。对于我一直在使用 phonegap-plugin-pushFirebase 的通知。

我正在为 Android 和 iOS 使用这个插件。在 Android 上它工作得非常好,当然我遇到了问题,但现在一切都完成了。另一方面,IOS将无法正常工作。该应用程序甚至无法构建。

如果我构建我会得到这个错误:

** 构建失败**

以下构建命令失败:

复制Plist文件 /Users/gio/app/Project/platforms/ios/build/emulator/Project.app/GoogleService-Info.plist /Users/gio/App/App/Project/platforms/ios/Project/Resources/GoogleService-Info.plist (1 次失败)

错误:命令的错误代码 65:带有 args 的 xcodebuild: -xcconfig,/Users/gio/app/Project/platforms/ios/cordova/build-debug.xcconfig,-workspace,Project.xcworkspace,-scheme,Project,-configuration,Debug,-sdk,iphonesimulator,-destination,platform =iOS 模拟器,名称 = iPhone SE,build,CONFIGURATION_BUILD_DIR=/Users/gio/app/Project/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/gio/app/Project/platforms/ios/build/sharedpch

您可以注意到应用正在搜索的路径有一个双“根”(/App/App/)

我猜编程是试图从一条不存在的路径中获取一些东西。

奇怪的是,它在 Android 上运行没有任何问题,而在 iOS 上却不行。

Cordova 版本:7.0.1

Cordova iOS 版本:4.4.0

【问题讨论】:

    标签: ios iphone cordova firebase phonegap-pushplugin


    【解决方案1】:

    确保你的 config.xml 中有这个:

    <platform name="ios">
        <resource-file src="GoogleService-Info.plist" />
    </platform>
    

    而且您的 GoogleService-Info.plist 文件位于您应用的根目录 via documentation

    如果这对您不起作用,我建议您改用cordova-plugin-fcm。我都用过,发现 cordova-plugin-fcm 效果最好。

    【讨论】:

    • 我已经在安装过程中添加了它。看来cordova 4.4.0 版有一个错误。下次更新会修复。
    猜你喜欢
    • 1970-01-01
    • 2021-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-13
    • 2021-09-24
    • 1970-01-01
    相关资源
    最近更新 更多