如何找到映射到特定Pod版本的软件包版本?

时间:2020-02-02 10:28:17

标签: flutter cocoapods flutter-dependencies

我只是从Flutter开始,这是我的第一个Flutter问题。 我正在尝试运行Flutter团队的Bloc Firebase登录项目。

我怀疑我的错误是由于Pod的版本问题引起的,因此经过一番研究,我发现这是由于GoogleSignIn (~> 5.0) pod引起的。现在,FLutter的google_sign_in: ^4.0.0包映射到iOS文件夹中GoogleSignIn (~> 5.0)中的Podfile.lock,但是我需要版本〜> 4.1.1,因为最新版本适用于Xcode 11,而我使用的是Xcode 10.2。 我如何选择要使用的Pod版本? 非常感谢您的帮助。

当我尝试手动将Podfile.lock更改为GoogleSignIn (~> 4.1.1)时,这是控制台中的错误:

[!] CocoaPods找不到Pod的兼容版本 “ GoogleSignIn”: 在快照(Podfile.lock)中: GoogleSignIn(= 5.0.2,〜> 4.1.1)

  In Podfile:
    google_sign_in (from `.symlinks/plugins/google_sign_in/ios`) was resolved to 0.0.1, which depends on
      GoogleSignIn (~> 5.0)

使用GoogleSignIn (~> 5.0)控制台输出此错误:

无法构建iOS应用Xcode版本输出错误:↳ **建立失败**

Xcode的输出:↳ ===带有配置调试的PROJECT Pod的构建总体目标google_sign_in_web 在/ Volumes / archivi recuperati / Flutter apps / bloc / examples / flutter_firebase_login / ios / Pods / AppAuth / Source / iOS / OIDAuthorizationService + IOS.m:20中包含的文件中: / Volumes / archivi recuperati / Flutter apps / bloc / examples / flutter_firebase_login / ios / Pods / AppAuth / Source / iOS / OIDExternalUserAgentIOS.h:30:1: 错误:预期为',' API_UNAVAILABLE(macCatalyst) ^ 在从/ Volumes / archivi recuperati / Flutter导入的模块“ Foundation”中 apps / bloc / examples / flutter_firebase_login / ios / Pods / AppAuth / Source / OIDAuthorizationService.h:19: 在从/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h导入的模块“ CoreFoundation”中: 6: 在从/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h导入的模块“达尔文”中: 16: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/os/availability.h:93:171: 注意:从宏“ API_UNAVAILABLE”扩展 #define API_UNAVAILABLE(...) API_UNAVAILABLE_GET_MACRO(__ VA_ARGS API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__ API_UNAVAILABLE3,__ API_UNAVAILABLE2,__ API_UNA 0)(__ VA_ARGS ) ^ 在/ Volumes / archivi recuperati / Flutter apps / bloc / examples / flutter_firebase_login / ios / Pods / AppAuth / Source / iOS / OIDAuthorizationService + IOS.m:21中包含的文件中: / Volumes / archivi recuperati / Flutter apps / bloc / examples / flutter_firebase_login / ios / Pods / AppAuth / Source / iOS / OIDExternalUserAgentCatalyst.h:28:26: 错误:预期为',' API_AVAILABLE(macCatalyst(13))API_UNAVAILABLE(ios) ^ 产生2个错误。

无法为模拟器构建应用程序。启动错误 iPhoneXʀ上的应用程序。

Flutter Doctor输出以下内容:

/ Users / vinnytwice / Developer / flutter / bin / flutter doctor --verbose [✓] Flutter(频道稳定,v1.12.13 + hotfix.7,在Mac OS X 10.13.6 17G65上, 语言环境en-IT) •位于/ Users / vinnytwice / Developer / flutter的Flutter 1.12.13 + hotfix.7版本 •Framework版本9f5ff2306b(6天前),2020年1月26日22:38:26 -0800 •发动机修订版a67792536c •Dart版本2.7.0

[✓] Android工具链-为Android设备开发(Android SDK 版本29.0.2) •位于/ Users / vinnytwice / Library / Android / sdk的Android SDK •未配置Android NDK位置(可选;对本机分析支持有用) •平台android-29,构建工具29.0.2 •Java二进制文件,位于:/ Applications / Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java •Java版本OpenJDK运行时环境(内部版本1.8.0_202-发行-1483-b49-5587405) •接受所有Android许可。

[✓] Xcode-为iOS和macOS开发(Xcode 10.2.1) •Xcode位于/Applications/Xcode.app/Contents/Developer •Xcode 10.2.1,内部版本10E1001 •CocoaPods版本1.8.1

[✓] Android Studio(3.5版) •位于/ Applications / Android Studio.app/Contents的Android Studio •Flutter插件版本43.0.1 •Dart插件版本191.8593 •Java版本OpenJDK运行时环境(内部版本1.8.0_202-发行-1483-b49-5587405)

[✓]已连接设备(1个可用) •iPhoneXʀ•0BCA279B-2F3A-4237-84D0-EF6379F7DB56•ios•com.apple.CoreSimulator.SimRuntime.iOS-12-2(模拟器)

•找不到问题!

1 个答案:

答案 0 :(得分:0)

好一会儿之后,我以为我将google_sign_in: ^4.0.0更改为google_sign_in: <4.0.0,它的工作就像一个魅力。现在,它映射到GoogleSignIn (~> 4.0)中的Podfile.loc。我想我对于为Flutter和Android Studio转储Swift和Xcode感到有些紧张,但我认为这并不是限制软件包版本的问题。 希望它能帮助别人。 干杯。