【问题标题】:Building Flutter 2.* project with Firebase in IOS Simulator在 IOS 模拟器中使用 Firebase 构建 Flutter 2.* 项目
【发布时间】:2021-09-13 15:18:26
【问题描述】:

我一直在努力让这个项目在 IOS 模拟器中成功构建。

我收到以下神秘错误:

While building module 'firebase_core' imported from
    /Users/shanejordan/Documents/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-2.5.2/ios/Classes/FLTSnapshotsInSyncStreamHan
    dler.m:6:
    In file included from <module-includes>:1:
    In file included from /Users/shanejordan/Repositories/HH/flutter_test_ios/ios/Pods/Target Support
    Files/firebase_core/firebase_core-umbrella.h:13:
    In file included from
    /Users/shanejordan/Documents/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.6.0/ios/Classes/FLTFirebaseCorePlugin.h:11:
    /Users/shanejordan/Documents/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.6.0/ios/Classes/FLTFirebasePlugin.h:9:9:
    error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin':
    '/Users/shanejordan/Repositories/HH/flutter_test_ios/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h'
    [-Werror,-Wnon-modular-include-in-framework-module]
    #import <FirebaseCore/FirebaseCore.h>
            ^
    1 error generated.
    /Users/shanejordan/Documents/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-2.5.2/ios/Classes/FLTSnapshotsInSyncStreamHan
    dler.m:6:9: fatal error: could not build module 'firebase_core'
    #import <firebase_core/FLTFirebasePluginRegistry.h>

我创建了一个新项目并且能够在 iOS 中正常运行它,但是一旦我添加了 firebase_core 的 pub,我就无法让它在 IOS 模拟器中运行。我一定遗漏了一些非常基本的东西。

我已经尝试了这个答案中的所有选项,完成了所有技巧,例如重建 podfiles、打开 xcode 和更改设置。没有任何效果。 Header file (FirebaseCore/FirebaseCore.h) not found, despite importing Firebase.framework

【问题讨论】:

    标签: ios flutter dart


    【解决方案1】:

    these steps 对你有帮助吗?

    1. 删除 ios/Pods 文件夹。

    2. 删除 Podfile 和 Podfile.lock

    3. 删除 pubspec.lock

    4. 打开终端,依次运行这些命令

      pod cache clean —all

      flutter clean

      flutter pub get

      pod install

    【讨论】:

    • 我尝试了这些步骤,但还没有成功。我可能需要找到一个存在 Firebase 的存储库,然后运行它并比较差异。
    猜你喜欢
    • 1970-01-01
    • 2020-07-11
    • 2014-06-22
    • 2021-01-15
    • 1970-01-01
    • 2021-08-31
    • 1970-01-01
    • 2021-11-14
    • 1970-01-01
    相关资源
    最近更新 更多