繁体   English   中英

在 flutter 运行期间出现错误。 错误有一些 pod 文件。 有谁知道如何解决?

[英]I'm getting error during flutter run. Error has something to pod file. Does anyone know how to resolve?

我做了 pod repo 更新。 它不工作。 我在 Mac 上运行。 我尝试重新安装 cocapods,但它也没有帮助。 我该如何解决这个问题? 现在真的被困了一天。 这是它给出的错误:

错误:CocoaPods 的规范存储库太旧,无法满足依赖关系。 要更新 CocoaPods 规范,请运行: pod repo update

运行 pod install 时出错 在 iPhone 13 上启动应用程序时出错。

Launching lib/main.dart on iPhone 13 in debug mode...
Running pod install...
CocoaPods' output:
↳
  Preparing

Analyzing dependencies

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

Finding Podfile changes
  - Flutter
  - cloud_firestore
  - firebase_auth
  - firebase_core
  - firebase_dynamic_links
  - firebase_storage
  - geolocator_apple
  - google_sign_in
  - image_cropper
  - image_picker
  - path_provider_ios
  - qr_code_scanner
  - share_plus
  - sqflite
  - url_launcher_ios

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 `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
firebase_auth: Using Firebase SDK version '8.9.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
firebase_core: Using Firebase SDK version '8.9.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_dynamic_links` from `.symlinks/plugins/firebase_dynamic_links/ios`
firebase_dynamic_links: Using Firebase SDK version '8.9.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_storage` from `.symlinks/plugins/firebase_storage/ios`
firebase_storage: Using Firebase SDK version '8.9.0' defined in 'firebase_core'
-> Fetching podspec for `geolocator_apple` from `.symlinks/plugins/geolocator_apple/ios`
-> Fetching podspec for `google_sign_in` from `.symlinks/plugins/google_sign_in/ios`
-> Fetching podspec for `image_cropper` from `.symlinks/plugins/image_cropper/ios`
-> Fetching podspec for `image_picker` from `.symlinks/plugins/image_picker/ios`
-> Fetching podspec for `path_provider_ios` from `.symlinks/plugins/path_provider_ios/ios`
-> Fetching podspec for `qr_code_scanner` from `.symlinks/plugins/qr_code_scanner/ios`
-> Fetching podspec for `share_plus` from `.symlinks/plugins/share_plus/ios`
-> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`
-> Fetching podspec for `url_launcher_ios` from `.symlinks/plugins/url_launcher_ios/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.10.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
  CDN: trunk Relative path: all_pods_versions_d_4_0.txt exists! Returning local because checking is only performed in repo update
  CDN: trunk Relative path: Specs/d/4/0/GoogleSignIn/6.1.0/GoogleSignIn.podspec.json exists! Returning local because checking is only performed in repo update
  CDN: trunk Relative path: all_pods_versions_3_7_4.txt exists! Returning local because checking is only performed in repo update
  CDN: trunk Relative path: Specs/3/7/4/TOCropViewController/2.6.0/TOCropViewController.podspec.json exists! Returning local because checking is only performed in repo update
  CDN: trunk Relative path: all_pods_versions_0_2_a.txt exists! Returning local because checking is only performed in repo update
  CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.11/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
  CDN: trunk Relative path: all_pods_versions_f_4_e.txt exists! Returning local because checking is only performed in repo update
  CDN: trunk Relative path: Specs/f/4/e/FMDB/2.7.5/FMDB.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 exists! Returning local because checking is only performed in repo update
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
  In snapshot (Podfile.lock):
    Firebase/CoreOnly (= 8.7.0)

  In Podfile:
    firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 1.10.6, which depends on
      Firebase/CoreOnly (= 8.9.0)


You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `Firebase/CoreOnly` inside your development pod `firebase_core`.
   You should run `pod update Firebase/CoreOnly` to apply changes you've made.

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `tap'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:257:in `process_topmost_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:94:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/install.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>'

Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
pod repo update

Error running pod install
Error launching application on iPhone 13.

好吧,基本上你的 CocoaPods 设置会坏掉。 您将不得不手动删除 Specs 存储库的任何本地副本并重新克隆 Specs 存储库的新版本。 您可以使用以下命令执行此操作:

经过大量解决方案应用后,我找到了一种成功解决此错误的方法,如下所示

可以通过在终端执行以下命令来解决。

Go 到项目内的 /ios 文件夹。 删除英特尔芯片用户的 Podfile.lock (YourPoject/ios/Podfile.lock)

运行 pod install --repo-update (确保您的 cd 进入 flutter 应用程序的 iOS 目录)对于 M1 芯片用户

首先安装 ffi(如果没有)在常规终端中使用命令: sudo arch -x86_64 gem install ffi 然后 arch -x86_64 pod install --repo-update

运行 flutter 清洁

完成后,重新构建您的 Flutter 应用程序: flutter 运行

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM