ios 链接器命令失败,退出代码为 1 -- Firebase
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50509245/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Linker command failed with exit code 1 -- Firebase
提问by Stevie Wonder
Fairly new to iOS development and have some had some trouble installing firebase into my iOS application. Essentially what the application will do is take information about trails around the country from a firebase database, this information is to be output to a tableview which will allow users to select one of the trails and answer some questions about the trail.
对 iOS 开发相当陌生,并且在将 firebase 安装到我的 iOS 应用程序中时遇到了一些问题。基本上,该应用程序将执行的操作是从 Firebase 数据库中获取有关全国各地路径的信息,该信息将输出到一个表格视图中,该视图将允许用户选择其中一条路径并回答有关该路径的一些问题。
While attempting to install the application I went through the steps which are outlined on the google site for "add firebase to your iOS app". The first stages went all fine without a hitch until I encountered stage 4.
在尝试安装该应用程序时,我完成了谷歌网站上概述的“将 firebase 添加到您的 iOS 应用程序”的步骤。第一阶段一切顺利,直到我遇到第 4 阶段。
When I enter import Firebase into the app.delegate file, I receive an error: Error on import Firebase in app.delegate file
当我在 app.delegate 文件中输入 import Firebase 时,我收到一个错误: 在 app.delegate 文件中导入 Firebase 时出错
On top of this, I now have another error which is preventing me from building the application, this is the error:
最重要的是,我现在有另一个错误阻止我构建应用程序,这是错误:
Linker command failed error, prevents application from building
Essentially, I need to know if I am making any glaring errors, which I probably am as I'm new to this, and also how to resolve these issues if possible.
从本质上讲,我需要知道我是否犯了任何明显的错误,我可能是新手,如果可能的话,我也需要知道如何解决这些问题。
Thanks.
谢谢。
采纳答案by Stevie Wonder
Make sure you're opening the .xcworkspace and not the .xcproject file in Xcode. Close the project and open .xcworkspace
确保您在 Xcode 中打开 .xcworkspace 而不是 .xcproject 文件。关闭项目并打开 .xcworkspace
回答by Faiz Fareed
First Install FireBase properly via CocoaPods. Try the following steps
首先通过 CocoaPods 正确安装 FireBase。尝试以下步骤
Step 1 - Quit the Xcode. (Don't just close the Xcode window, right click and Quit it explicitly).
步骤 1 - 退出 Xcode。(不要只是关闭 Xcode 窗口,右键单击并明确退出)。
Step 2 - Clear your derived data. You can find your derived data in here
第 2 步 - 清除您的派生数据。您可以在此处找到派生数据
~/Library/Developer/Xcode/DerivedData
〜/图书馆/开发人员/Xcode/DerivedData
Step 3 - Open your .xcworkspace, Not .xcproject
第 3 步 - 打开您的 .xcworkspace,而不是 .xcproject
Step 4 - Clean your project by pressing ?+Shift+Kkeys
第 4 步 - 按?+Shift+K键清理您的项目
Step 5 - Build your project by pressing ?+Bkeys
第 5 步 - 按?+B键构建您的项目