【问题标题】:Getting error when running app on iOS simulator in Flutter after installing cloud_firestore package安装 cloud_firestore 包后在 Flutter 中的 iOS 模拟器上运行应用程序时出错
【发布时间】:2021-06-17 00:12:59
【问题描述】:

安装cloud_firestore 包后,在iOS 模拟器上运行时,我什至尝试过pod update Firebase/Firestore 仍然出现以下错误。

甚至我也尝试过多次删除 Podfile.lock 和 flutter clean 然后 flutter run

注意

  1. Flutter 版本:Flutter 2.0.2

  2. 飞镖 2.12.1

    无法构建 iOS 应用 Xcode 构建的错误输出: ↳ ** 构建失败 **

    Xcode's output:
    ↳
        In file included from /Users/gwl/firebase_demo/ios/Pods/abseil/absl/base/internal/thread_identity.cc:26:
        In file included from /Users/gwl/firebase_demo/ios/Pods/abseil/absl/base/call_once.h:34:
        /Users/gwl/firebase_demo/ios/Pods/abseil/absl/base/internal/invoke.h:42:10: fatal error: 'absl/meta/type_traits.h' file not found
        #include "absl/meta/type_traits.h"
                 ^~~~~~~~~~~~~~~~~~~~~~~~~
        /Users/gwl/firebase_demo/ios/Pods/abseil/absl/base/internal/invoke.h:42:10: note: did not find header 'meta/type_traits.h' in framework 'absl' (loaded from
        '/Users/gwl/firebase_demo/build/ios/Debug-iphonesimulator/abseil')
        1 error generated.
        note: Using new build system
        note: Building targets in parallel
        note: Planning build
        note: Constructing build description
    
    Could not build the application for the simulator.
    Error launching application on iPhone 11.
    

【问题讨论】:

标签: ios flutter google-cloud-firestore flutter-dependencies absl-py


【解决方案1】:

你需要删除 podfile.lock

然后你需要从 XCode 运行 iOS 文件夹来为你的项目加载资产

转到ios文件夹并执行pod install,如果不存在则执行pod init然后pod install

请尝试 Xcode -> 产品 -> 运行

【讨论】:

    【解决方案2】:

    首先删除 podfile.lock 并按照以下步骤操作;

    flutter clean
    flutter pub get
    cd ios
    pod install
    flutter run
    

    如果不起作用,请检查您的颤振通道并将其更改为 beta。

    flutter pub upgrade
    flutter channel beta
    flutter clean
    cd ios
    pod install
    flutter run
    

    您也可以在下面切换回稳定输入;

    flutter channel beta
    

    【讨论】:

      【解决方案3】:

      这解决了我的问题GitHub issue

      尝试在您的 ios 目录中运行这些命令:

      rm -rf Pods
      rm -rf Podfile.lock
      rm -rf ~/.pub-cache/hosted/pub.dartlang.org/
      pod cache clean --all
      flutter clean
      flutter pub get
      pod repo update
      pod install
      

      【讨论】:

        猜你喜欢
        • 2019-05-29
        • 2020-07-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-11-22
        • 2021-05-21
        • 2021-07-30
        • 2021-12-22
        相关资源
        最近更新 更多