最近要更新一个flutter项目,结果彻底破坏了iOS上的依赖树。
原始错误消息显示以下内容:
Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
pod repo update
运行后,接着是
pod install
。我收到以下消息:
[!] CocoaPods could not find compatible versions for pod "GoogleSignIn":
In snapshot (Podfile.lock):
GoogleSignIn (= 7.0.0, ~> 7.0)
In Podfile:
google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) was resolved to 0.0.1, which depends on
GoogleSignIn (~> 7.1)
[!] CocoaPods could not find compatible versions for pod "GoogleSignIn":
In snapshot (Podfile.lock):
GoogleSignIn (= 7.0.0, = 7.1)
In Podfile:
google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) was resolved to 0.0.1, which depends on
GoogleSignIn (~> 7.1)
You have either:
* changed the constraints of dependency `GoogleSignIn` inside your development pod `google_sign_in_ios`.
You should run `pod update GoogleSignIn` to apply changes you've made.
更新该 pod 后,我在不同的 pod 中遇到相同的错误,或者最终收到相同的消息。
这是我的
pubspec.yaml
# Prevent accidental publishing to pub.dev.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: '>=3.1.1 <4.0.0'
dependencies:
auth_repository:
path: packages/auth_repository
form_inputs:
path: packages/form_inputs
equatable: ^2.0.5
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cached_network_image: ^3.2.3
qr_flutter: ^4.1.0
firebase_core: ^2.15.1
mobile_scanner: ^3.5.5
flutter_riverpod: ^2.4.9 # Use the latest version
firebase_auth: ^4.17.8
google_sign_in: ^6.2.1
sign_in_with_apple: ^5.0.0
image_picker: ^1.0.8
firebase_messaging: ^14.7.19
cloud_firestore: ^4.15.8
json_annotation: ^4.8.1
flutter_dotenv: ^5.1.0
datetime_picker_formfield: ^2.0.1
bloc: ^8.1.4
flutter_bloc: ^8.1.5
flow_builder: ^0.1.0
formz: ^0.6.1
font_awesome_flutter: ^10.7.0
easy_search_bar: ^2.5.0
date_picker_plus: ^4.0.0
flutter_typeahead: ^5.2.0
multi_select_flutter: ^4.1.3
bloc_test: ^9.1.7
intl: 0.19.0
http: ^1.2.0
mockito: ^5.4.4
objectid: ^3.0.0
url_launcher: ^6.3.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
test: ^1.24.9
build_runner: ^2.4.12
flutter:
uses-material-design: true
# Enable generation of localized Strings from arb files.
generate: true
assets:
# Add assets from the images directory to the application.
- assets/images/
- .env
尝试在 Podfile 中将最低 iOS 版本更改为 11。