【问题标题】:no such module 'firebase' error occurring in macbook m1macbook m1中没有发生这样的模块'firebase'错误
【发布时间】:2021-05-05 10:36:20
【问题描述】:

我在这个网站上尝试了所有可能的答案,但都没有奏效。我添加了一个 pod 文件,但在导入 Firebase 后,我不断收到 (No such module 'Firebase') 错误

我正在使用带有 M1 的 Macbook Air

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


【问题讨论】:

标签: ios xcode firebase flutter


【解决方案1】:

试试这个 1)清理派生数据 2)强制相当Xcode 3)检查在安装 pod 时是否出现任何错误 4)而不是导入 Firebase 尝试 import FirebaseCore 告诉我这对你有什么影响? 您在项目中使用 Coredata 吗?

【讨论】:

  • 你在使用核心数据吗?
  • 是的,我尝试添加,但没有奏效
  • 嘿,这就是问题所在,我遇到了类似的问题,但是当我从项目中删除核心数据时它工作正常,也许有更好的解决方案,但这对我有帮助
  • 我删除了 import Firebase 和 FirebaseApp.configure(),只是使用了 flutter clean 并且问题得到了解决。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-01-04
  • 2015-11-12
  • 1970-01-01
  • 1970-01-01
  • 2016-11-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多