iOS 上的 Firebase 应用检查在构建时崩溃

Posted

技术标签:

【中文标题】iOS 上的 Firebase 应用检查在构建时崩溃【英文标题】:Firebase app check on iOS get crash on build 【发布时间】:2021-12-29 19:17:54 【问题描述】:

在我添加包firebase_app_check: ^0.0.3之前,每个想法都运行良好

该应用在构建项目时崩溃,无法在 ios 上运行,但在 android 上运行良好。

Andoird 应用可以连接到 firebase,但是 iOS 不能这样做,因为请求没有经过身份验证。

颤振:2.5.2

详细

CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Finding Podfile changes
      A firebase_app_check
      - Flutter
      - cloud_firestore
      - cloud_functions


 Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
    cloud_firestore: Using Firebase SDK version '8.9.0' defined in 'firebase_core'
    -> Fetching podspec for `cloud_functions` from `.symlinks/plugins/cloud_functions/ios`


 Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.9.1/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.9.0/Firebase.podspec.json


[!] CocoaPods could not find compatible versions for pod "Firebase/AppCheck":
      In Podfile:
        firebase_app_check (from `.symlinks/plugins/firebase_app_check/ios`) was resolved to 0.0.3, which depends on
          Firebase/AppCheck (= 8.9.0)

    Specs satisfying the `Firebase/AppCheck (= 8.9.0)` dependency were found, but they required a higher minimum deployment target.




.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'

【问题讨论】:

【参考方案1】:

platform :ios, '11.0' 添加到 Podfile。

AppCheckrequires iOS 11.

【讨论】:

【参考方案2】:

我认为,您的 CocoaPods 设置将会崩溃。因为 firebaseAppcheck 版本问题。您将不得不手动删除 Specs 存储库的任何本地副本并重新克隆 Specs 存储库的新版本。您可以使用以下命令执行此操作:

在终端执行以下命令即可解决。

1. Go to /ios folder inside your Project.
2. Delete Podfile.lock (YourPoject/ios/Podfile.lock)
3. Delete Project.Workspace file.
3. Run pod install --repo-update (Make sure your cd into the iOS directory of the flutter app)
4. Run flutter clean
5. Once complete, rebuild your Flutter application: flutter run

如果上述步骤不适用于您的项目。你也可以试试这个:

 1. change the higher minimum deployment target (at least 11). 
 2. Just Follow the above steps.

【讨论】:

以上是关于iOS 上的 Firebase 应用检查在构建时崩溃的主要内容,如果未能解决你的问题,请参考以下文章

iOS 上的 Firebase Crashlytics 设置?

IOS 应用未显示在 Firebase Analytics 中

Google Firebase iOS 构建将文件上传到 Mac 上的存储,但在 iPad 上运行时触发 StorageException

如何处理 firebase 动态链接的生命周期? (iOS)

Firebase - 构建数据库的正确方法

iOS中的Firebase注册错误通过本机反应