生成失败的Xcode 10 Cordova Firebase项目 [英] Build failed Xcode 10 cordova firebase project

查看:138
本文介绍了生成失败的Xcode 10 Cordova Firebase项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为iOS建立一个cordova项目,并试图添加Firebase SDK.我根据需要安装了Cocoapods,然后安装了cordova-plugin-firebasex;我打开了.xcworkspace,并按如下所示更改了target中的Build设置:

I'm building a cordova project for iOS and I'm trying to add Firebase SDK. I installed Cocoapods as required, then I installed cordova-plugin-firebasex; I opened my .xcworkspace and changed Build settings in target as follows:

构建设置详细信息

然后在platform/ios文件夹中运行pod install,进入根目录adn,键入sudo cordova prepare ios;我更新了Xcode 10中的窗口,进入了目标的构建阶段,并选中了仅在安装时运行脚本"框,如下所示:

Then ran pod install in platforms/ios folder, went to the root directory adn typed sudo cordova prepare ios; I updated the window in Xcode 10, went in Build Phases of target and checked the box 'Run scripts only when installing' as follows:

复选框焦点

我还尝试替换原始路径,即

I also tried to replace the original path, i.e.

diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null

变成这样:

diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null

无论如何我都会遇到此错误:

anyway I'm getting this error:

/Users/davide/Desktop/cordova-plugin-firebasex-test/platforms/ios/FirebaseTest/Plugins/cordova-plugin-firebasex/AppDelegate+FirebasePlugin.m:3:9:'Firebase.h'找不到文件

/Users/davide/Desktop/cordova-plugin-firebasex-test/platforms/ios/FirebaseTest/Plugins/cordova-plugin-firebasex/AppDelegate+FirebasePlugin.m:3:9: 'Firebase.h' file not found

我尝试先删除Podfile.lock,然后再删除pod install,然后尝试先执行pod deintegratepod clean,然后再次pod install,再尝试pod repo update,我仍然被卡住,无法构建项目对于iOS.

I tried do remove Podfile.lock and then pod install, tried to do pod deintegrate and pod clean, then again pod install, tried also pod repo update, I'm still stuck and fail to build my project for iOS.

有什么建议吗? 谢谢戴维(Davide)

Any suggestions? Thanks, Davide

推荐答案

我遇到了同样的问题.

I has the same problem.

问题在于文件"Firebase.h"仅是未安装在Cocoapods库中的真实"Firebase.h"的链接.所以问题出在可可足类.甚至运行Pod Clean,Pod安装,ecc.不能解决,因为没有写任何地方安装库.

The problem was that the file "Firebase.h" was only a link to the real "Firebase.h" that was not installed in Cocoapods libraries. So the problem was with Cocoapods. Even run pod clean, pod install, ecc. didn't resolve, cause nowhere was written to install the libraries.

然后我注意到插件未正确配置podfile.

Then I noticed that the podfile was not correctly configured by the plugin.

因此,尝试将其打开(在XCODE中,在Pods文件夹中的podfile中),并验证是否类似于:

So, try to open it (in XCODE, podfile in Pods folder) and verify that is something like:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target 'your project' do
    project 'your project.xcodeproj'
    pod 'Firebase/Core', '6.3.0'
    pod 'Firebase'
    pod 'Firebase/Auth', '6.3.0'
    pod 'Firebase/Messaging', '6.3.0'
    pod 'Firebase/Performance', '6.3.0'
    pod 'Firebase/RemoteConfig', '6.3.0'
    pod 'Fabric', '1.9.0'
    pod 'Crashlytics', '3.12.0'
end

如果没有,请尝试手动编写,然后转到platform/ios文件夹并运行pod install.现在您可以注意到Cocoapods安装了所有库.

If not, try to write it manually, then go to your platforms/ios folder and run pod install. Now you can notice that Cocoapods install all the libraries.

我在编译时还遇到了其他一些小问题,但是,在执行此操作之后,删除插件并重新安装它可以解决它们.

I has also some other little problem compiling, but, after this operations, removing the plugin and reinstalling it resolved them.

我希望这会有所帮助.

I hope this can help.

这篇关于生成失败的Xcode 10 Cordova Firebase项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆