这是发生的事情:
在Xcode版本7.3.1(7D1014)上运行
pod 'Firebase/Core'
导入类中的Firebase
unresolved on Database
然后我添加了数据库框架
pod 'Firebase/Database'
unresolved on FirebaseApp
似乎2个框架处于互斥模式 . 他们不能共存 .
我已经尝试了一切:更新,安装,卸载,重新创建项目,重新创建工作区 . 所有 .
愿你帮助我 . 上次Firebase版本是否有错误?
import FirebaseCore
然后你可以使用 FirebaseApp.configure() . 我正在使用swift 4 .
FirebaseApp.configure()
将 pod 'Firebase/Core' 替换为 pod 'Firebase' . 然后运行 pod repo update .
pod 'Firebase'
pod repo update
我在podfile中添加了'Firebase'和'Firebase / Core',它对我有用
它对我有用
pod repo update pod update
然后运行 at the location of the pod file :
pod install
重建我的应用程序后,错误应该消失 .
我有一个类似的问题 .
你的进口声明是:
import Firebase
确保重新启动Xcode并清理构建文件夹 .
它正在为我工作并摆脱“使用未解析的标识符FirebaseApp ...”错误
Update: 对于Swift 4.2: FirebaseApp.configure() 确实有效 . [FIRApp重命名为FirebaseApp]
听起来您可能正在使用较旧版本的Firebase . 试试 -
仔细检查Firebase 4.0正在安装中 .
还尝试导入特定模块 . 因此,而不是 import Firebase 使用 import FirebaseDatabase 或 import FirebaseAuth .
import FirebaseDatabase
import FirebaseAuth
使用FIRApp.configure()而不是Firebase.configure()
sudo gem install cocoapods pod update
今天我的工作:
1. in Xcode 9.1
import UIKit import Firebase import UserNotifications import FirebaseInstanceID import FirebaseMessaging import FirebaseCrash import FirebaseAnalytics @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { FirebaseApp.configure() return true }
2. My PodFile
pod 'Firebase' pod 'Firebase/Core' pod 'Firebase/Database' pod 'Firebase/Crash' pod 'Firebase/RemoteConfig' pod 'Firebase/Storage' pod 'FirebaseUI', '~> 4.0' pod 'Firebase/Auth' pod 'Firebase/Messaging'
3. finale:
4. restart xcode:
5. press: shift-alt-command-k (in xcode)
这将删除构建文件夹中的所有产品和中间文件 . 它与删除派生数据不同 .
6. an clean
DONE
9 回答
然后你可以使用
FirebaseApp.configure()
. 我正在使用swift 4 .将
pod 'Firebase/Core'
替换为pod 'Firebase'
. 然后运行pod repo update
.我在podfile中添加了'Firebase'和'Firebase / Core',它对我有用
它对我有用
然后运行 at the location of the pod file :
重建我的应用程序后,错误应该消失 .
我有一个类似的问题 .
你的进口声明是:
确保重新启动Xcode并清理构建文件夹 .
它正在为我工作并摆脱“使用未解析的标识符FirebaseApp ...”错误
Update: 对于Swift 4.2:
FirebaseApp.configure()
确实有效 . [FIRApp重命名为FirebaseApp]听起来您可能正在使用较旧版本的Firebase . 试试 -
仔细检查Firebase 4.0正在安装中 .
还尝试导入特定模块 . 因此,而不是
import Firebase
使用import FirebaseDatabase
或import FirebaseAuth
.使用FIRApp.configure()而不是Firebase.configure()
今天我的工作:
1. in Xcode 9.1
2. My PodFile
3. finale:
4. restart xcode:
5. press: shift-alt-command-k (in xcode)
这将删除构建文件夹中的所有产品和中间文件 . 它与删除派生数据不同 .
6. an clean
DONE