无法在Swift应用程序中导入Firebase sdk

时间:2021-10-02 20:01:30

I have developed demo ios application where I need to integrate Firebase, so I had followed the Raywenderlitch tutorials for how to integrate the Firebase SDKs in iOS who written by @David East.

我开发了需要集成Firebase的demo ios应用程序,所以我遵循了Raywenderlitch的教程,学习了如何在ios中集成由@David East编写的Firebase sdk。

After I had installed the Firebase SDKs via cocoapods, when I try to command-click on the import statement of Firebase in AppDelegate.swift(import Firebase) file, xcode goes to the following view. For more information please find the below screenshot.

在我通过cocoapods安装了Firebase sdk之后,当我尝试命令单击AppDelegate中Firebase的导入语句时。快速(导入Firebase)文件,xcode进入以下视图。有关更多信息,请参见下面的截图。

无法在Swift应用程序中导入Firebase sdk

Please find the below Podfile :

请找到下面的播客:

platform :ios, '8.0'
use_frameworks!

target 'SampleApplication' do

pod 'IQKeyboardManager'
pod 'Koloda'
pod 'Firebase'

end

post_install do |installer|
    `find Pods -regex 'Pods/pop.*\\.h' -print0 | xargs -0 sed -i '' 's/\\(<\\)pop\\/\\(.*\\)\\(>\\)/\\"\\2\\"/'`
end

Also I had also reviewed the issues on SO who answered by @David East, please find the below.

另外,我也审阅了邮件@David East回复SO who的问题,请查看如下。

1) Cannot import Firebase in Swift app
2) Cannot Import Firebase Into Swift Class

1)无法在Swift app中导入Firebase 2)无法将Firebase导入Swift类

But the solution is not worked in my case. Please help me what I'm doing wrong.

但我的情况并没有解决这个问题。请帮帮我,我做错了什么。

Thanks in advance.

提前谢谢。

Update
I had also tried to add the framework manually from firebase official website for Integrate without CocoaPods but it still get the issues. For more information please find the below screenshot.

更新我也尝试从firebase官方网站手动添加框架来集成,但它仍然有问题。有关更多信息,请参见下面的截图。

无法在Swift应用程序中导入Firebase sdk

I had upload my sample application source code on dropbox, if you want then please review it. Source Code Link : https://www.dropbox.com/s/5jr0zbnymhou94c/TestFireBase.zip?dl=0

我已经上传了我的样本应用程序源代码在dropbox上,如果你想,请审查它。源代码链接:https://www.dropbox.com/s/5jr0zbnymhou94c/testfirebase.zip?

1 个解决方案

#1


1  

The Firebase SDK heavily changed on May 16, 2016. This changed the names of the pods and their respective functionality.

Firebase SDK在2016年5月16日发生了重大变化。这改变了豆荚的名称和它们各自的功能。

The new pod name for the standard Firebase SDK is Firebase/Core, which includes only Firebase Analytics. If you're upgrading from the old Firebase system, you probably only need these:

标准Firebase SDK的新pod名称是Firebase/Core,它只包含Firebase分析。如果您正在从旧的消防系统升级,您可能只需要以下这些:

pod 'Firebase/Core'      # Firebase Analytics
pod 'Firebase/Database'  # Firebase Realtime Database
pod 'Firebase/Auth'      # Firebase Authentication

If you're using other Firebase functionality, refer to https://firebase.google.com/docs/ios/setup for other podnames. Don't forget that regardless of what you choose, you need to include Firebase/Core.

如果您正在使用其他的Firebase功能,请参考https://firebase.google.com/docs/ios/setup来获取其他的podname。不要忘记,无论您选择什么,您都需要包含Firebase/Core。

#1


1  

The Firebase SDK heavily changed on May 16, 2016. This changed the names of the pods and their respective functionality.

Firebase SDK在2016年5月16日发生了重大变化。这改变了豆荚的名称和它们各自的功能。

The new pod name for the standard Firebase SDK is Firebase/Core, which includes only Firebase Analytics. If you're upgrading from the old Firebase system, you probably only need these:

标准Firebase SDK的新pod名称是Firebase/Core,它只包含Firebase分析。如果您正在从旧的消防系统升级,您可能只需要以下这些:

pod 'Firebase/Core'      # Firebase Analytics
pod 'Firebase/Database'  # Firebase Realtime Database
pod 'Firebase/Auth'      # Firebase Authentication

If you're using other Firebase functionality, refer to https://firebase.google.com/docs/ios/setup for other podnames. Don't forget that regardless of what you choose, you need to include Firebase/Core.

如果您正在使用其他的Firebase功能,请参考https://firebase.google.com/docs/ios/setup来获取其他的podname。不要忘记,无论您选择什么,您都需要包含Firebase/Core。