运行时出现以下错误
pod install
。
[!] CocoaPods could not find compatible versions for pod "PhoneNumberKit/PhoneNumberKitCore":
In Podfile:
PhoneNumberKit (from `https://github.com/marmelroy/PhoneNumberKit`) was resolved to 3.6.5, which depends on
PhoneNumberKit/PhoneNumberKitCore (= 3.6.5)
flutter_libphonenumber_ios (from `.symlinks/plugins/flutter_libphonenumber_ios/ios`) was resolved to 1.1.0, which depends on
PhoneNumberKit/PhoneNumberKitCore (= 3.6.0)
Specs satisfying the `PhoneNumberKit/PhoneNumberKitCore (= 3.6.0), PhoneNumberKit/PhoneNumberKitCore (= 3.6.5)` dependency were found, but they required a higher minimum deployment target.
我已尝试按照建议增加最低部署目标,但所有版本似乎都无法解决问题。 我当前的部署目标是
12.0
。
我还再次删除了我的 Podfile.lock
和 pod install,但仍然失败。
我也运行过pod repo update
但没有成功。
我已经运行了
flutter clean
并再次获得了依赖项,但这些似乎仍然不起作用。
我也在运行最新版本的
flutter_libphonenumber: 2.1.4
。
在尝试了所有提到的选项并肯定失败后,我终于找到了一个临时解决方案。 该问题是由添加到 Podfile 中的 github 存储库引起的:
pod 'PhoneNumberKit', :git => 'https://github.com/marmelroy/PhoneNumberKit'
这是由 ios 安装说明中的
flutter_libphonenumber: 2.1.4
文档提供的。
然而,该存储库引入了新版本 3.6.5
,而该软件包仅支持 3.6.0
。
为了提供所需的支持,我创建了一个包含源文件的存储库
3.6.0
https://github.com/BTonny/PhoneNumberKit-3.6.0
所以我继续将其添加到我的 Podfile 中
pod 'PhoneNumberKit', :git => 'https://github.com/BTonny/PhoneNumberKit-3.6.0'
这暂时解决了我的依赖性问题,我希望
flutter_libphonenumber
团队最终能解决这个问题,然后我们就可以恢复。
我刚刚更改了 pubspec.yaml 文件中的phone_number 依赖项的版本,它开始工作。 电话号码:^1.0.0