CocoaPods找不到Pod“FirebaseCore”的兼容版本:运行flutter iOS build的pod install时出错

hgqdbh6s  于 2023-04-22  发布在  Flutter
关注(0)|答案(4)|浏览(268)

我在flutter for iOS上使用最新的firebase_core sdk运行“pod install”时出现以下错误。我清除了Pod,symlinks文件夹并删除了Podfile.lock文件,然后运行pod install,但结果与下面相同。这里的问题是什么?

Analyzing dependencies
cloud_firestore: Using Firebase SDK version '9.2.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '9.2.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '9.2.0' defined in 'firebase_core'
Warning: firebase_app_id_file.json file does not exist. This may cause issues in upload-symbols. If this error is unexpected, try running flutterfire configure again.
firebase_crashlytics: Using Firebase SDK version '9.2.0' defined in 'firebase_core'
firebase_dynamic_links: Using Firebase SDK version '9.2.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '9.2.0' defined in 'firebase_core'
firebase_storage: Using Firebase SDK version '9.2.0' defined in 'firebase_core'
**[!] CocoaPods could not find compatible versions for pod "FirebaseCore":
  In Podfile:
    firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 1.19.2, which depends on
      Firebase/CoreOnly (= 9.2.0) was resolved to 9.2.0, which depends on
        FirebaseCore (= 9.2.0)

    firebase_storage (from `.symlinks/plugins/firebase_storage/ios`) was resolved to 10.3.2, which depends on
      Firebase/Storage (= 9.2.0) was resolved to 9.2.0, which depends on
        FirebaseStorage (~> 9.2.0) was resolved to 9.2.0, which depends on
          FirebaseCore (~> 9.0)

    google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
      GoogleMLKit/LinkFirebase (~> 2.2.0) was resolved to 2.2.0, which depends on
        MLKitLinkFirebase (~> 1.3.0) was resolved to 1.3.0, which depends on
          FirebaseCore (~> 8.0)

CocoaPods could not find compatible versions for pod "MLKitVision":
  In Podfile:
    google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
      GoogleMLKit/ImageLabeling (~> 2.2.0) was resolved to 2.2.0, which depends on
        MLKitImageLabeling (~> 1.3.0) was resolved to 1.3.0, which depends on
          MLKitVision (~> 1.3)

    google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
      GoogleMLKit/PoseDetection (~> 2.2.0) was resolved to 2.2.0, which depends on
        MLKitPoseDetection (~> 1.0.0-beta4) was resolved to 1.0.0-beta6, which depends on
          MLKitXenoCommon (= 1.0.0-beta6) was resolved to 1.0.0-beta6, which depends on
            MLKitVision (~> 2.0)**
mrwjdhj3

mrwjdhj31#

安装干净:

sudo gem install cocoapods-clean

在项目的文件夹中运行disintegrate:

pod deintegrate

修改你的podfile(删除你不想再使用的pods所在的行),然后运行:

pod install

pod update
wi3ka0sx

wi3ka0sx2#

就这么做:

pod repo update && pod install --repo-update
kx1ctssn

kx1ctssn3#

删除Pods文件夹、.symlinks文件夹和Podfile.lock。然后运行pod install并重试

vwkv1x7d

vwkv1x7d4#

Flutter mlkit插件不支持Firebase版本10,因此您需要降级。
兼容的依赖项:

google_mlkit_text_recognition: ^0.5.0
firebase_core: ^1.24.0
firebase_analytics: ^9.1.5
cloud_firestore: ^3.5.1
firebase_crashlytics: ^2.9.0
firebase_auth: ^3.11.2

dependency_overrides:
    firebase_core_platform_interface: 4.5.1

将此添加到Podfile顶部

$FirebaseSDKVersion = '9.6.0'

相关问题