将Firebase导入Xcode项目中的问题

时间:2019-09-11 20:54:47

标签: swift xcode firebase

按照步骤操作后,我可以将“导入Firebase”错误处理到我的AppDelegate中,但仍然无法在我的代码中配置Firebase!

我已经创建了一个Firebase帐户,并下载了“ GoogleService-Info.plist”并将其添加到我的项目中,还使用了“ pod init”,对其进行了编辑以添加Firebase Core,Auth,Database和“ pod install”来创建xcworkspace。 但是,在我的AppDelegate中使用“导入Firebase”之后,我收到了“无法构建Objective-C模块Firebase”错误。我将产品/方案更改为“ Firebase”,但错误消失了,但在要配置的代码中仍然无法识别Firebase。

任何线索我都会非常感激!

3 个答案:

答案 0 :(得分:1)

enter image description here

使用pod安装框架时,打开项目使用.xcworkspace文件

答案 1 :(得分:0)

因此,在AppDelegate.swift文件的didFinishLaunchingWithOptions函数中,添加FirebaseApp.configure()并确保删除。如果收到手臂错误,请确保从头开始统计一个新项目,然后再次添加Firebase podfile。它应该工作。

答案 2 :(得分:0)

也许您已经使用xcworkspace打开了项目