我试图建立一个IOSFlutter项目,但它是不断抱怨的兼容版本的pod。我已经尝试了许多线程,因为过去两天,但无法解决这个问题。不过我的Android版本运行良好。
我尝试删除podfile.lock,podfile,podfolder,Runner.xcworkspace,但没有任何效果。现在我不再拥有podfile.lock文件了。我的意思是podfile.lock没有被创建。
macOS Big Sur版本11.6
MacBook Pro 2019
处理器:2.3 GHz Intel Core i9
在我的Podfile中:
platform :ios, '10.0'
我还尝试了以下命令:
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
运行pod install命令时,出现以下错误。
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
cloud_functions: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_analytics: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_crashlytics: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_database: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_in_app_messaging: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_storage: Using Firebase SDK version '7.3.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 0.7.0, which depends on
Firebase/CoreOnly (= 7.3.0) was resolved to 7.3.0, which depends on
FirebaseCore (= 7.3.0)
firebase_database (from `.symlinks/plugins/firebase_database/ios`) was resolved to 6.0.0, which depends on
Firebase/Database (= 7.3.0) was resolved to 7.3.0, which depends on
FirebaseDatabase (~> 7.3.0) was resolved to 7.3.0, which depends on
FirebaseCore (~> 7.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 "GoogleAppMeasurement":
In Podfile:
firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) was resolved to 7.0.1, which depends on
Firebase/Analytics (= 7.3.0) was resolved to 7.3.0, which depends on
Firebase/Core (= 7.3.0) was resolved to 7.3.0, which depends on
FirebaseAnalytics (= 7.3.0) was resolved to 7.3.0, which depends on
GoogleAppMeasurement (= 7.3.0)
google_mobile_ads (from `.symlinks/plugins/google_mobile_ads/ios`) was resolved to 0.0.1, which depends on
Google-Mobile-Ads-SDK (= 8.5.0) was resolved to 8.5.0, which depends on
GoogleAppMeasurement (< 9.0, >= 7.0)
CocoaPods could not find compatible versions for pod "MLKitCommon":
In Podfile:
google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
GoogleMLKit/BarcodeScanning (~> 2.2.0) was resolved to 2.2.0, which depends on
GoogleMLKit/MLKitCore (= 2.2.0) was resolved to 2.2.0, which depends on
MLKitCommon (~> 3.0.0)
google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
GoogleMLKit/BarcodeScanning (~> 2.2.0) was resolved to 2.2.0, which depends on
MLKitBarcodeScanning (~> 1.3.0) was resolved to 1.3.0, which depends on
MLKitCommon (~> 3.0)
google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
GoogleMLKit/PoseDetectionAccurate (~> 2.2.0) was resolved to 2.2.0, which depends on
MLKitPoseDetectionAccurate (~> 1.0.0-beta4) was resolved to 1.0.0-beta5, which depends on
MLKitCommon (~> 3.1)
CocoaPods could not find compatible versions for pod "MLKitXenoCommon":
In Podfile:
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-beta5, which depends on
MLKitXenoCommon (= 1.0.0-beta5)
google_ml_kit (from `.symlinks/plugins/google_ml_kit/ios`) was resolved to 0.6.0, which depends on
GoogleMLKit/PoseDetectionAccurate (~> 2.2.0) was resolved to 2.2.0, which depends on
MLKitPoseDetectionAccurate (~> 1.0.0-beta4) was resolved to 1.0.0-beta4, which depends on
MLKitXenoCommon (= 1.0.0-beta4)
我也试过this线程,但不为我工作...
任何帮助将不胜感激。。
2条答案
按热度按时间kkih6yb81#
请尝试以下步骤:
如果你有英特尔芯片
1.在pubspec.yml文件中更新所有依赖项到最新版本并做'get pub'
1.转到您的Podfile并取消注解#platform:ios,'9.0'然后将版本更改为10 platform:ios,'10.0'
1.通过终端转到ios文件夹并执行“pod repo update”
1.'pod update'或'pod install'
如果您有M1芯片
1.在pubspec.yml文件中将所有依赖项更新到最新版本,并执行'getpub'
1.转到您的Podfile并取消注解#platform:ios,'9.0'然后将版本更改为10 platform:ios,'10.0'
1.通过终端转到ios文件夹并执行“arch -x86_64 pod repo update”
1.'arch -x86_64 pod update'或'arch -x86_64 pod install'
klh5stk12#
该错误明确表示您的cocopod文件中存在兼容性问题,这可能是在更新flutter依赖项时引起的。您可以通过重新配置pod文件来解决此问题:运行这些命令。
清理Build和升级pod文件
Flutter 清洗
扑式酒吧
Flutter升级
重新安装Pod文件并更新
光盘 ios
pod cache clean --all
Pod清洁
荚果分解
sudo gem install cocoapods-decompose cocoapods-clean
sudo arch -x86_64 gem install ffi
arch -x86_64 pod存储库更新
arch -x86_64 pod安装