我在本网站上尝试了所有可能的答案,但没有一个奏效。我添加了一个 pod 文件,但在导入 Firebase 后,我不断收到(No such module 'Firebase')错误
我使用 Macbook Air 和 M1
import UIKit
import Flutter
import Firebase
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
FirebaseApp.configure()
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
这是我的 pod 文件的样子
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Runner
end
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics', '7.2-M1'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
答案 0 :(得分:0)
试试这个 1)清理派生数据
2)强制相当Xcode
3)检查安装pods时是否有任何错误
4) 而不是导入 Firebase 尝试
import FirebaseCore
告诉我这对你来说如何?
你在你的项目中使用 Coredata 吗??