CocoaPods 找不到 pod“Firebase/Core”|cloud_firestore、Flutter 的兼容版本
CocoaPods could not find compatible versions for pod "Firebase/Core” | cloud_firestore, Flutter
我在广告连播中遇到了一些问题,请参阅下文
正在 iPhone X 上以调试模式启动 lib/main.dart...
运行 pod 安装...
CocoaPods 的输出:
↳
准备
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Fetching external sources
-> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
-> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
-> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`
Resolving dependencies of `Podfile`
[!] CocoaPods could not find compatible versions for pod "Firebase/Core":
In Podfile:
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
Firebase/Core
Specs satisfying the `Firebase/Core` dependency were found, but they required a higher minimum deployment target.
CocoaPods could not find compatible versions for pod "GoogleUtilities/MethodSwizzler":
In Podfile:
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
Firebase/Core was resolved to 5.8.0, which depends on
FirebaseAnalytics (= 5.1.2) was resolved to 5.1.2, which depends on
GoogleUtilities/MethodSwizzler (~> 5.2.0)
Specs satisfying the `GoogleUtilities/MethodSwizzler (~> 5.2.0)` dependency were found, but they required a higher minimum deployment target.
CocoaPods could not find compatible versions for pod "gRPC-Core":
In Podfile:
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
Firebase/Firestore was resolved to 5.8.0, which depends on
FirebaseFirestore (= 0.13.3) was resolved to 0.13.3, which depends on
gRPC-C++ (~> 0.0.3) was resolved to 0.0.3, which depends on
gRPC-C++/Implementation (= 0.0.3) was resolved to 0.0.3, which depends on
gRPC-Core (= 1.14.0)
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
Firebase/Firestore was resolved to 5.8.0, which depends on
FirebaseFirestore (= 0.13.3) was resolved to 0.13.3, which depends on
gRPC-ProtoRPC (~> 1.0) was resolved to 1.14.1, which depends on
gRPC-ProtoRPC/Main (= 1.14.1) was resolved to 1.14.1, which depends on
gRPC (= 1.14.1) was resolved to 1.14.1, which depends on
gRPC/Main (= 1.14.1) was resolved to 1.14.1, which depends on
gRPC-Core (= 1.14.1)
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:308:in `tap'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/resolver.rb:123:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:781:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:779:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:88:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:243:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:116:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command/install.rb:41:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'
CocoaPods 的错误输出:
↳
[33m警告:CocoaPods 要求您的终端使用 UTF-8 编码。
考虑将以下内容添加到 ~/.profile:
export LANG=en_US.UTF-8
[0m
[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
错误运行 pod 安装
在 iPhone X.
上启动应用程序时出错
我有类似的问题。将 Project、Target 和 Podfile 设置为 iOS 12 并失败。
这是我的 Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '12.0'
use_frameworks!
abstract_target 'all_pods' do
pod 'Alamofire'
pod 'AlamofireImage'
pod 'AlamofireNetworkActivityIndicator'
pod 'Atributika'
pod 'AXPhotoViewer'
pod 'Cache'
pod 'Crashlytics'
pod 'Fabric'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Google-Mobile-Ads-SDK'
pod 'GTMNSStringHTMLAdditions'
pod 'KVLoading'
pod 'MGSwipeTableCell'
pod 'ReachabilitySwift'
pod 'SDCAlertView'
pod 'SideMenuSwift'
pod 'SwiftyJSON'
pod 'SwiftyUserDefaults'
pod 'UIImageViewAlignedSwift'
target 'Test Poject' do
# all_pods
end
end
先解体确定
pod 分解
运行 强制回购更新
pod 安装 --repo-update
Updating local specs repositories
$ /usr/bin/git -C /Users/XYZ/.cocoapods/repos/master fetch origin --progress
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 9 (delta 6), reused 0 (delta 0), pack-reused 0
From https://github.com/CocoaPods/Specs
8b2bcbd42ee..f72b5a3a02a master -> origin/master
$ /usr/bin/git -C /Users/XYZ/.cocoapods/repos/master rev-parse --abbrev-ref HEAD
master
$ /usr/bin/git -C /Users/XYZ/.cocoapods/repos/master reset --hard origin/master
HEAD is now at f72b5a3a02a [Add] DSJSONSchemaValidation 2.0.4
CocoaPods 1.6.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.6.0.beta.1
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Firebase/Core":
In Podfile:
Firebase/Core
Specs satisfying the `Firebase/Core` dependency were found, but they required a higher minimum deployment target.
CocoaPods could not find compatible versions for pod "GoogleUtilities/MethodSwizzler":
In Podfile:
Firebase/Core was resolved to 5.8.0, which depends on
FirebaseAnalytics (= 5.1.2) was resolved to 5.1.2, which depends on
GoogleUtilities/MethodSwizzler (~> 5.2.0)
Specs satisfying the `GoogleUtilities/MethodSwizzler (~> 5.2.0)` dependency were found, but they required a higher minimum deployment target.
pod update
应该可以解决问题。不客气:-)
我遇到了同样的问题,但这对我有帮助。
pod 'Firebase/Core', '>= 0'
pod 'FirebaseCrashlytics', '>= 0'
它将 FirebaseCore 和 FirebaseCrashlytics 更新到最新版本
我的设置:VS Code,Flutter
如果您没有 Podfile.lock
文件并且 pod update
没有帮助,试试这个:
- 转到项目中的
ios/Pods/Local Podspecs
目录
- 检查每个
json
文件以找到所需的最高 ios 版本。我的 "ios": "10.0"
其中一些
- 返回
ios/
目录
- 打开
Podfile
文件
- 取消注释
# platform :ios, '9.0'
并将 9.0
替换为第 2 步中的版本,例如 10.0
。
# platform :ios, '9.0'
> platform :ios, '10.0'
- 运行
pod install
错误应该消失了
我在使用 firebase Admob 时遇到了类似的问题,我的问题是我同时使用了 admob_flutter 和 firebase_admob 包。一旦我从 pubspec.yaml 中删除了 admob_flutter 包,一切都完美无缺!
只是在 pod 文件上取消注释
# platform :ios, '9.0'
并用
platform :ios, '10.0'
然后删除 Podfile.lock 并重新安装您的应用程序
我遇到了这个问题:
为了解决这个问题,我打开了 Podfile。那么
我取消注释 platform: ios, '8.0'
并将其替换为 platform :ios, '10.0'
,如其他答案中所述。
我替换了下面的代码:
target 'Runner' do
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.3.0'
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
使用此代码:
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
pod 'Firebase/Core'
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
end
- 在终端中,我 运行 在
ios
文件夹中执行以下命令。
$ pod install
一切顺利。我没有看到任何问题,但有很多基本上与 Installing FirebaseX...
相关的绿色日志,最后我收到了这条消息:
Pod installation complete! There are 8 dependencies from the Podfile and 24 total pods installed.
解决问题 (Intelli J)
签入IOSflutter文件夹Podfile.lock生成
运行 'flutter doctor -v' 识别 Flutter,Dart,Xcode 和 CocoaPods 的版本。
如果找不到 cocoa pods,请按照安装命令进行操作。
sudo gem 卸载 cocoapods
brew uninstall cocoapods
sudo gem 安装 cocoapods
吊舱设置
在 Podfile 中 - 取消注释平台:ios、'9.0' 并将其替换为平台:ios、'10.0'。
运行 构建
正在 iPhone 12 Pro Max 上以调试模式启动 lib/main.dart...
运行ning pod 安装...
运行宁 Xcode 构建...
Xcode 构建完成。
enter image description here
我的工作是:
- 转到文件 %project%/ios/.symlinks/plugins/firebase_core/ios/firebase_sdk_version.rb
- 将此
def firebase_sdk_version!() '8.7.0' end
更改为 def firebase_sdk_version!() '8.5.0' end
- 运行
pod install
在您的 Podfile 中,添加您想在您的应用中使用的 Firebase pods。
平台:ios,‘10.0’
为 Google Analytics
添加 Firebase pod
连播 'Firebase/Analytics'
对于没有 IDFA 收集功能的 Analytics,请改用此 pod
pod‘Firebase/AnalyticsWithoutAdIdSupport’
为您要在应用中使用的任何其他 Firebase 产品添加 pods
例如,使用 Firebase 身份验证和 Cloud Firestore
连播 'Firebase/Auth'
吊舱 'Firebase/Firestore'
这 3 个步骤对我有用。
将 cocoapods 升级到最新版本:
sudo gem install cocoapods
删除/Pods
文件夹和Podfile.lock
文件
运行 pod repo update
在 mac M1 上(在 ios 文件夹中),尝试 arch -x86_64 pod update
。为我工作
我必须在 Podfile 中更新。
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.0.0'
.
到新版本。
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.9.1'
我遇到了类似的错误:
Specs satisfying the `firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)` dependency were found, but they required a higher minimum deployment target.
什么对我不起作用:
根据其他答案,我去了 Podfile
并更新了:
- 来自:
# platform :ios, '9.0'
- 至:
platform :ios, '13.0'
然后再次尝试 flutter run
但这次卡在了:
Running Xcode build...
.
等待很不自然,我的耐心越来越少,所以我放弃了这个更改并寻找另一个解决方案。
最后,对我有用的是:
flutter clean
flutter pub get
flutter run
无需修改 Podfile
即可指定最小 ios 目标
这里同时存在两个问题。由于 firebase dep,无法更新 cocoa pods。并且由于最小部署目标而无法更新。
做:
- pod 重新整合
- 取消注释 pod 文件中的第二行并提升 te 平台:iOS 到 11.0
- 广告连播更新
这就是诀窍
如果您 运行ning 在 Mac M1 芯片上,请尝试 运行 此命令:
arch -x86_64 pod install --repo-update
使用 M1 芯片 (2022) 的 Mac :
有什么诀窍:
- 在
<project>/ios/
中的 Podfile
文件中将 platform :ios, '9.0'
更改为 platform :ios, '11.0'
- 然后更新如下:
arch -x86_64 pod install --repo-update
在您的终端 (<project>/ios/
)
将安装所有依赖项和 pods!
尽情享受吧!
对于拥有带 M1 芯片的 Apple Mac 的用户:
-> 试试这个顺序希望你能看到...pods 正在安装。
- sudo arch -x86_64 gem 安装 ffi
arch -x86_64 pod install
或 arch -x86_64 pod update
或 arch -x86_64 pod install --repo-update
我在广告连播中遇到了一些问题,请参阅下文
正在 iPhone X 上以调试模式启动 lib/main.dart... 运行 pod 安装... CocoaPods 的输出: ↳ 准备
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Fetching external sources
-> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
-> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
-> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`
Resolving dependencies of `Podfile`
[!] CocoaPods could not find compatible versions for pod "Firebase/Core":
In Podfile:
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
Firebase/Core
Specs satisfying the `Firebase/Core` dependency were found, but they required a higher minimum deployment target.
CocoaPods could not find compatible versions for pod "GoogleUtilities/MethodSwizzler":
In Podfile:
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
Firebase/Core was resolved to 5.8.0, which depends on
FirebaseAnalytics (= 5.1.2) was resolved to 5.1.2, which depends on
GoogleUtilities/MethodSwizzler (~> 5.2.0)
Specs satisfying the `GoogleUtilities/MethodSwizzler (~> 5.2.0)` dependency were found, but they required a higher minimum deployment target.
CocoaPods could not find compatible versions for pod "gRPC-Core":
In Podfile:
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
Firebase/Firestore was resolved to 5.8.0, which depends on
FirebaseFirestore (= 0.13.3) was resolved to 0.13.3, which depends on
gRPC-C++ (~> 0.0.3) was resolved to 0.0.3, which depends on
gRPC-C++/Implementation (= 0.0.3) was resolved to 0.0.3, which depends on
gRPC-Core (= 1.14.0)
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
Firebase/Firestore was resolved to 5.8.0, which depends on
FirebaseFirestore (= 0.13.3) was resolved to 0.13.3, which depends on
gRPC-ProtoRPC (~> 1.0) was resolved to 1.14.1, which depends on
gRPC-ProtoRPC/Main (= 1.14.1) was resolved to 1.14.1, which depends on
gRPC (= 1.14.1) was resolved to 1.14.1, which depends on
gRPC/Main (= 1.14.1) was resolved to 1.14.1, which depends on
gRPC-Core (= 1.14.1)
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:308:in `tap'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/resolver.rb:123:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:781:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:779:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:88:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:243:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:116:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command/install.rb:41:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'
CocoaPods 的错误输出: ↳ [33m警告:CocoaPods 要求您的终端使用 UTF-8 编码。 考虑将以下内容添加到 ~/.profile:
export LANG=en_US.UTF-8
[0m
[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
错误运行 pod 安装 在 iPhone X.
上启动应用程序时出错我有类似的问题。将 Project、Target 和 Podfile 设置为 iOS 12 并失败。
这是我的 Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '12.0'
use_frameworks!
abstract_target 'all_pods' do
pod 'Alamofire'
pod 'AlamofireImage'
pod 'AlamofireNetworkActivityIndicator'
pod 'Atributika'
pod 'AXPhotoViewer'
pod 'Cache'
pod 'Crashlytics'
pod 'Fabric'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Google-Mobile-Ads-SDK'
pod 'GTMNSStringHTMLAdditions'
pod 'KVLoading'
pod 'MGSwipeTableCell'
pod 'ReachabilitySwift'
pod 'SDCAlertView'
pod 'SideMenuSwift'
pod 'SwiftyJSON'
pod 'SwiftyUserDefaults'
pod 'UIImageViewAlignedSwift'
target 'Test Poject' do
# all_pods
end
end
先解体确定
pod 分解
运行 强制回购更新
pod 安装 --repo-update
Updating local specs repositories
$ /usr/bin/git -C /Users/XYZ/.cocoapods/repos/master fetch origin --progress
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 9 (delta 6), reused 0 (delta 0), pack-reused 0
From https://github.com/CocoaPods/Specs
8b2bcbd42ee..f72b5a3a02a master -> origin/master
$ /usr/bin/git -C /Users/XYZ/.cocoapods/repos/master rev-parse --abbrev-ref HEAD
master
$ /usr/bin/git -C /Users/XYZ/.cocoapods/repos/master reset --hard origin/master
HEAD is now at f72b5a3a02a [Add] DSJSONSchemaValidation 2.0.4
CocoaPods 1.6.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.6.0.beta.1
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Firebase/Core":
In Podfile:
Firebase/Core
Specs satisfying the `Firebase/Core` dependency were found, but they required a higher minimum deployment target.
CocoaPods could not find compatible versions for pod "GoogleUtilities/MethodSwizzler":
In Podfile:
Firebase/Core was resolved to 5.8.0, which depends on
FirebaseAnalytics (= 5.1.2) was resolved to 5.1.2, which depends on
GoogleUtilities/MethodSwizzler (~> 5.2.0)
Specs satisfying the `GoogleUtilities/MethodSwizzler (~> 5.2.0)` dependency were found, but they required a higher minimum deployment target.
pod update
应该可以解决问题。不客气:-)
我遇到了同样的问题,但这对我有帮助。
pod 'Firebase/Core', '>= 0'
pod 'FirebaseCrashlytics', '>= 0'
它将 FirebaseCore 和 FirebaseCrashlytics 更新到最新版本
我的设置:VS Code,Flutter
如果您没有 Podfile.lock
文件并且 pod update
没有帮助,试试这个:
- 转到项目中的
ios/Pods/Local Podspecs
目录 - 检查每个
json
文件以找到所需的最高 ios 版本。我的"ios": "10.0"
其中一些 - 返回
ios/
目录 - 打开
Podfile
文件 - 取消注释
# platform :ios, '9.0'
并将9.0
替换为第 2 步中的版本,例如10.0
。# platform :ios, '9.0'
>platform :ios, '10.0'
- 运行
pod install
错误应该消失了
我在使用 firebase Admob 时遇到了类似的问题,我的问题是我同时使用了 admob_flutter 和 firebase_admob 包。一旦我从 pubspec.yaml 中删除了 admob_flutter 包,一切都完美无缺!
只是在 pod 文件上取消注释
# platform :ios, '9.0'
并用
platform :ios, '10.0'
然后删除 Podfile.lock 并重新安装您的应用程序
我遇到了这个问题:
为了解决这个问题,我打开了 Podfile。那么
我取消注释
platform: ios, '8.0'
并将其替换为platform :ios, '10.0'
,如其他答案中所述。我替换了下面的代码:
target 'Runner' do
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.3.0'
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
使用此代码:
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
pod 'Firebase/Core'
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
end
- 在终端中,我 运行 在
ios
文件夹中执行以下命令。
$ pod install
一切顺利。我没有看到任何问题,但有很多基本上与 Installing FirebaseX...
相关的绿色日志,最后我收到了这条消息:
Pod installation complete! There are 8 dependencies from the Podfile and 24 total pods installed.
解决问题 (Intelli J)
签入IOSflutter文件夹Podfile.lock生成
运行 'flutter doctor -v' 识别 Flutter,Dart,Xcode 和 CocoaPods 的版本。
如果找不到 cocoa pods,请按照安装命令进行操作。
sudo gem 卸载 cocoapods brew uninstall cocoapods
sudo gem 安装 cocoapods 吊舱设置
在 Podfile 中 - 取消注释平台:ios、'9.0' 并将其替换为平台:ios、'10.0'。
运行 构建
正在 iPhone 12 Pro Max 上以调试模式启动 lib/main.dart... 运行ning pod 安装... 运行宁 Xcode 构建... Xcode 构建完成。
enter image description here
我的工作是:
- 转到文件 %project%/ios/.symlinks/plugins/firebase_core/ios/firebase_sdk_version.rb
- 将此
def firebase_sdk_version!() '8.7.0' end
更改为def firebase_sdk_version!() '8.5.0' end
- 运行
pod install
在您的 Podfile 中,添加您想在您的应用中使用的 Firebase pods。
平台:ios,‘10.0’
为 Google Analytics
添加 Firebase pod连播 'Firebase/Analytics'
对于没有 IDFA 收集功能的 Analytics,请改用此 pod
pod‘Firebase/AnalyticsWithoutAdIdSupport’
为您要在应用中使用的任何其他 Firebase 产品添加 pods
例如,使用 Firebase 身份验证和 Cloud Firestore
连播 'Firebase/Auth' 吊舱 'Firebase/Firestore'
这 3 个步骤对我有用。
将 cocoapods 升级到最新版本:
sudo gem install cocoapods
删除
/Pods
文件夹和Podfile.lock
文件运行
pod repo update
在 mac M1 上(在 ios 文件夹中),尝试 arch -x86_64 pod update
。为我工作
我必须在 Podfile 中更新。
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.0.0'
.
到新版本。
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.9.1'
我遇到了类似的错误:
Specs satisfying the `firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)` dependency were found, but they required a higher minimum deployment target.
什么对我不起作用:
根据其他答案,我去了 Podfile
并更新了:
- 来自:
# platform :ios, '9.0'
- 至:
platform :ios, '13.0'
然后再次尝试 flutter run
但这次卡在了:
Running Xcode build...
.
等待很不自然,我的耐心越来越少,所以我放弃了这个更改并寻找另一个解决方案。
最后,对我有用的是:
flutter clean
flutter pub get
flutter run
无需修改 Podfile
即可指定最小 ios 目标
这里同时存在两个问题。由于 firebase dep,无法更新 cocoa pods。并且由于最小部署目标而无法更新。
做:
- pod 重新整合
- 取消注释 pod 文件中的第二行并提升 te 平台:iOS 到 11.0
- 广告连播更新
这就是诀窍
如果您 运行ning 在 Mac M1 芯片上,请尝试 运行 此命令:
arch -x86_64 pod install --repo-update
使用 M1 芯片 (2022) 的 Mac :
有什么诀窍:
- 在
<project>/ios/
中的 - 然后更新如下:
arch -x86_64 pod install --repo-update
在您的终端 (<project>/ios/
)
Podfile
文件中将 platform :ios, '9.0'
更改为 platform :ios, '11.0'
将安装所有依赖项和 pods!
尽情享受吧!
对于拥有带 M1 芯片的 Apple Mac 的用户:
-> 试试这个顺序希望你能看到...pods 正在安装。
- sudo arch -x86_64 gem 安装 ffi
arch -x86_64 pod install
或arch -x86_64 pod update
或arch -x86_64 pod install --repo-update