【发布时间】:2017-06-13 20:54:03
【问题描述】:
所以我是 Firebase 的新手,我正在关注这个关于如何将 Swift 应用程序连接到 Firebase 的教程,这完全适合他。但是当我尝试导入“FirebaseDatabase”时,它给了我这个错误;
无法将模块“fireBaseDatabase”加载为“FirebaseDatabase”
我想知道如何解决这个问题。谢谢。
这是我的 podfile;
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'FIRBaseQuickStart' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for FIRBaseQuickStart
pod ‘Firebase’
pod ‘Firebase/Database’
end
现在,当我尝试运行应用程序时,它会显示“线程 1:信号 SIGABRT”。
import UIKit
import Firebase
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
它在类声明行给我错误。这太令人沮丧了。
【问题讨论】:
-
您能否更新您的问题以包含与此相关的代码?你是说你试图在班级顶部写
import FirebaseDatabase?我想帮忙,但我不太清楚你的意思。 -
你找到解决方案了吗?
标签: swift firebase module firebase-realtime-database