我遵循了有关如何在我的项目上设置 geofire 的精确指南。我在我的 android 项目上取得了成功..但我无法让它在 ios 上运行..并且当我尝试运行它时出现以下错误。
[!] CocoaPods could not find compatible versions for pod "Firebase/Database":
In Podfile:
firebase_database (from `.symlinks/plugins/firebase_database/ios`) was resolved to 6.1.2, which depends on
Firebase/Database (= 7.11.0)
flutter_geofire (from `.symlinks/plugins/flutter_geofire/ios`) was resolved to 0.0.1, which depends on
GeoFire (~> 4.0) was resolved to 4.1.0, which depends on
Firebase/Database (~> 6.0)
我尝试运行
pod update
,这就是结果
Macbook-MBP:ios Macbook$ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
firebase_auth: Using Firebase SDK version '7.11.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '7.11.0' defined in 'firebase_core'
firebase_database: Using Firebase SDK version '7.11.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "Firebase/Database":
In Podfile:
firebase_database (from `.symlinks/plugins/firebase_database/ios`) was resolved to
6.1.2, which depends on Firebase/Database (= 7.11.0)
flutter_geofire (from `.symlinks/plugins/flutter_geofire/ios`) was resolved to 0.0.1,
which depends on
GeoFire (~> 4.0) was resolved to 4.1.0, which depends on
Firebase/Database (~> 6.0)
这就是我导入到我的 pubspec.yaml 文件中的内容..
firebase_database: ^6.1.2
flutter_geofire: ^2.0.0
我不明白我做错了什么,任何帮助将不胜感激..谢谢
对于面临此问题的任何人,
flutter clean
pod 'GeoFire', :git => 'https://github.com/mrdishant/geofire-objc', :tag => '4.3.0'
use_frameworks!
platform :ios, '10.0'
更改为 platform :ios, '11.0'
pod repo update
然后pod update
flutter run
这就是我让它为我工作的方式
将 Podfile 中配置的平台更新为
platform :ios, '10.0'
对我来说不起作用。我必须将 iOS 部署目标更新为 10.0 - 位于 Runner > Info > Deployment Target
之后,使用
rm -rf Podfile.lock
删除 Podfile.lock,然后运行 pod update
和 pod install
解决了我的问题。
这里同样的问题。我已经尝试修复好几个星期了。网上也查不到任何东西。如果你弄清楚了请留言!抱歉,我还没有足够的“声誉点”来发表评论:(
面临同样的挑战,但上述所有解决方案都不适合我。 什么对我有用:
在 IDE 中,转到项目文件 -> ios -> .symlinks -> 插件 -> firebase_database -> ios
查找:s.ios.deployment_target = '12.0'
我认为“s.ios.deployment_target”应该小于或等于Podfile中的“platform :ios, 'XX.0'”。
将 s.ios.deployment_target 值更改为小于平台:ios 中的值后,在 podfile 中,尝试删除 Podfile.lock、pod install --repo-update 等。
对其他抛出错误的 podfile 执行相同的操作,在您的情况下:flutter_geofire、firebase_database 等。
您也可以检查此解决方案。 [https://stackoverflow.com/questions/65881232/specs-satisfying-the-firebase-admob-but-they-required-a-higher-minimum-deploy]
复制您的文件并将其替换为以下代码。 应该有效。
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'GeoFire', :git => 'https://github.com/mrdishant/geofire-objc'
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
这对我有用 1 - 颤动清洁 2 - 颤振运行