无法在Swift应用中导入Firebase SDK [英] Cannot import Firebase sdk in Swift app

查看:130
本文介绍了无法在Swift应用中导入Firebase SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了demo ios应用程序,我需要集成 Firebase ,所以我按照



请找到下面的Podfile:

  platform:ios,'8.0'
use_frameworks!
$ b $ target'SampleApplication'do

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

end

post_install do | installer |
`find Pods -regex'Pods / pop。* \\.h'-print0 | (< \\)pop \\ / \\(。* \\)\\(> \ \\\\\\\\\\\\\\\\'\\\\\\'\\\\\\\\\\\' b $ b

另外我也回顾了那些由@David East回答的问题,请在下面找到。

1)



我已经将我的示例应用程序源代码上传到了Dropbox上,如果您需要,请回顾一下。
源代码链接 https ://www.dropbox.com/s/5jr0zbnymhou94c/TestFireBase.zip?dl = 0

解决方案

Firebase SDK在2016年5月16日发生了重大变化。这改变了pod的名称及其各自的功能。


$ b

标准Firebase SDK的新pod名称是 Firebase / Core ,其中仅包含Firebase Analytics。如果您是从旧的Firebase系统进行升级,则可能只需要这些:

  pod'Firebase / Core'#Firebase Analytics 
pod'Firebase / Database'#Firebase实时数据库
pod'Firebase / Auth'#Firebase身份验证

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


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.

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.

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.

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

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.

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

解决方案

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

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:

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.

这篇关于无法在Swift应用中导入Firebase SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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