我在我的Flutter应用程序中添加了firebase_analytics
,并且在Android上运行良好。但是,在使用Codemagic构建应用程序时,当我尝试构建iOS版本时出现了一个含糊的错误。本地构建似乎没有问题。
Fetching external sources
-> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
-> Fetching podspec for `firebase_analytics` from `.symlinks/plugins/firebase_analytics/ios`
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
Resolving dependencies of `Podfile`
[!] CocoaPods could not find compatible versions for pod "Firebase/Core":
In snapshot (Podfile.lock):
Firebase/Core (= 6.5.0)
In Podfile:
firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) was resolved to 0.0.1, which depends on
Firebase/Core
It seems like you've changed the constraints of dependency `Firebase/Core` inside your development pod `firebase_analytics`.
You should run `pod update Firebase/Core` to apply changes you've made.
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:257:in `process_topmost_state'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/resolver.rb:88:in `resolve'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer/analyzer.rb:939:in `block in resolve_dependencies'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/user_interface.rb:64:in `section'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer/analyzer.rb:937:in `resolve_dependencies'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer/analyzer.rb:118:in `analyze'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:398:in `analyze'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:221:in `block in resolve_dependencies'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/user_interface.rb:64:in `section'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:220:in `resolve_dependencies'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:156:in `install!'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/command/install.rb:51:in `run'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/command.rb:52:in `run'
/Users/builder/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/cocoapods-1.7.5/bin/pod:55:in `<top (required)>'
/Users/builder/.rbenv/versions/2.3.6/bin/pod:22:in `load'
/Users/builder/.rbenv/versions/2.3.6/bin/pod:22:in `<main>'
Error output from CocoaPods:
↳
[!] 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`.
Error running pod install
Application failed to start. Will not run test. Quitting.
我的pubspec.lock文件正确引用了最新版本的firebase_analytics和firebase core:
firebase_analytics:
dependency: "direct main"
description:
name: firebase_analytics
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.2"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.0+8"
我的Podfile.lock看起来不太奇怪(虽然我不知道应该寻找什么):
PODS:
- Firebase/Analytics (6.5.0):
- Firebase/Core
- Firebase/Core (6.5.0):
- Firebase/CoreOnly
- FirebaseAnalytics (= 6.0.4)
- Firebase/CoreOnly (6.5.0):
- FirebaseCore (= 6.1.0)
- firebase_analytics (0.0.1):
- Firebase/Analytics (~> 6.0)
- Firebase/Core
- Flutter
- firebase_core (0.0.1):
- Firebase/Core
- Flutter
- FirebaseAnalytics (6.0.4):
- FirebaseCore (~> 6.1)
- FirebaseInstanceID (~> 4.2)
- GoogleAppMeasurement (= 6.0.4)
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
- GoogleUtilities/MethodSwizzler (~> 6.0)
- GoogleUtilities/Network (~> 6.0)
- "GoogleUtilities/NSData+zlib (~> 6.0)"
- nanopb (~> 0.3)
- FirebaseCore (6.1.0):
- GoogleUtilities/Environment (~> 6.0)
- GoogleUtilities/Logger (~> 6.0)
- FirebaseInstanceID (4.2.2):
- FirebaseCore (~> 6.0)
- GoogleUtilities/Environment (~> 6.0)
- GoogleUtilities/UserDefaults (~> 6.0)
pod update
吗? - Paul Beusterienpod update
,但是我的 Podfile.lock 没有发生任何变化。 - bamnet# Uncomment the next line to define a global platform for your project
。下一行看起来是这样的:# platform :ios, 'X.0'
。其中的X.0
代表了你的 iOS 平台版本。尝试将它的注释去掉,只需删除#
符号即可。同时,查看报错提供的链接。 - MαπμQμαπkγVπ.0