【发布时间】:2020-05-18 09:07:26
【问题描述】:
我刚开始使用 Flutter,这是我的第一个 Flutter 问题。 我正在尝试运行 Flutter 团队的 Bloc Firebase Login 项目。
我怀疑我的错误是由于 Pod 的版本问题,所以经过一番研究我发现这是由于 GoogleSignIn (~> 5.0) pod 造成的。现在 FLutter 的 google_sign_in: ^4.0.0 包映射到 iOS 文件夹中 Podfile.lock 中的 GoogleSignIn (~> 5.0),但我需要版本 ~> 4.1.1,因为更新的版本适用于 Xcode 11 而我使用的是 Xcode 10.2。
如何选择要使用的 Pod 版本?
非常感谢您的帮助。
当我尝试手动将 Podfile.lock 更改为 GoogleSignIn (~> 4.1.1)时,这是控制台中的错误:
[!] CocoaPods 找不到 pod 的兼容版本 “谷歌登录”: 在快照(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 的输出:↳ === 使用配置调试构建聚合目标 google_sign_in_web 项目 Pod === 在 /Volumes/archivi recuperati/Flutter apps/bloc/examples/flutter_firebase_login/ios/Pods/AppAuth/Source/iOS/OIDAuthorizationService+IOS.m:20 包含的文件中: /Volumes/archivi recuperati/Flutter 应用程序/bloc/examples/flutter_firebase_login/ios/Pods/AppAuth/Source/iOS/OIDExternalUserAgentIOS.h:30:1: 错误:预期的“,” API_UNAVAILABLE(macCatalyst) ^ 在从 /Volumes/archivi recuperati/Flutter 导入的模块“Foundation”中 应用程序/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 导入的模块“Darwin”中: 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_UNAVAILABLE1, 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 应用程序/bloc/examples/flutter_firebase_login/ios/Pods/AppAuth/Source/iOS/OIDExternalUserAgentCatalyst.h:28:26: 错误:预期的“,” API_AVAILABLE(macCatalyst(13)) API_UNAVAILABLE(ios) ^ 生成 2 个错误。
无法为模拟器构建应用程序。启动错误 iPhone X 上的应用程序。
Flutter Doctor 输出如下:
/Users/vinnytwice/Developer/flutter/bin/flutter doctor --verbose [✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Mac OS X 10.13.6 17G65, 环境 en-IT) • Flutter 版本 1.12.13+hotfix.7,位于 /Users/vinnytwice/Developer/flutter • 框架修订 9f5ff2306b(6 天前),2020-01-26 22:38:26 -0800 • 引擎版本 a67792536c • Dart 版本 2.7.0
[✓] Android 工具链 - 为 Android 设备开发(Android SDK 版本 29.0.2) • Android SDK 位于 /Users/vinnytwice/Library/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-release-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) • Android Studio 位于 /Applications/Android Studio.app/Contents • Flutter 插件版本 43.0.1 • Dart 插件版本 191.8593 • Java 版 OpenJDK 运行时环境(内部版本 1.8.0_202-release-1483-b49-5587405)
[✓] 已连接设备(1 个可用) • iPhone Xʀ • 0BCA279B-2F3A-4237-84D0-EF6379F7DB56 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-2(模拟器)
• 未发现任何问题!
【问题讨论】:
标签: flutter cocoapods flutter-dependencies