【发布时间】:2021-09-14 21:12:02
【问题描述】:
如果我添加了 google_sign_in 包,我将无法构建 iOS 应用程序。
如果我尝试在 Flutter 稳定通道上构建项目,那么我从 Xcode 构建中得到错误输出: XCode 输出
链接 GTMAppAuth (armv7) 0.1 秒 ld /Users/.../Library/Developer/Xcode/DerivedData/Runner-bdrpdvvoklyybneytvtgveizdgsa/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/GTMAppAuth.build/Objects-normal/armv7/二进制/GTMAppAuth 正常 armv7(在项目“Pods”的目标“GTMAppAuth”中) cd /Users/.../Documents/cardaji/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target armv7-apple-ios9.0 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk -L/Users/lucky/Library/Developer/Xcode/DerivedData/Runner-bdrpdvvoklyybneytvtgveizdgsa/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/GTMAppAuth -F/Users/lucky/Library/Developer/Xcode/DerivedData/Runner-bdrpdvvoklyybneytvtgveizdgsa/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/GTMAppAuth -F/Users/lucky/Library/Developer/Xcode/DerivedData/Runner-bdrpdvvoklyybneytvtgveizdgsa/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/AppAuth -F/Users/lucky/Library/Developer/Xcode/DerivedData/Runner-bdrpdvvoklyybneytvtgveizdgsa/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/GTMSessionFetcher -filelist /Users/lucky/Library/Developer/Xcode/DerivedData/Runner-bdrpdvvoklyybneytvtgveizdgsa/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/GTMAppAuth.build/Objects-normal/armv7/GTMAppAuth .LinkFileList -install_name @rpath/GTMAppAuth.framework/GTMAppAuth -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/lucky/Library/Developer/Xcode/DerivedData/Runner-bdrpdvvoklyybneytvtgveizdgsa/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/GTMAppAuth.build/Objects-normal/armv7/GTMAppAuth_lto.o -fembed-bitcode -Xlinker -bitcode_verify -Xlinker -bitcode_hide_symbols -Xlinker -bitcode_symbol_map -Xlinker /Users/lucky/Library/Developer/Xcode/DerivedData/Runner-bdrpdvvoklyybneytvtgveizdgsa/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos /GTMAppAuth -fobjc-arc -fobjc-link-runtime -framework Security -weak_framework AuthenticationServices -framework AppAuth -framework Foundation -framework GTMSessionFetcher -framework Security -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/lucky/Library/Developer/Xcode/DerivedData/Runner-bdrpdvvoklyybneytvtgveizdgsa/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build /Release-iphoneos/GTMAppAuth.build/Objects-normal/armv7/GTMAppAuth_dependency_info.dat -o /Users/lucky/Library/Developer/Xcode/DerivedData/Runner-bdrpdvvoklyybneytvtgveizdgsa/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/GTMAppAuth.build/Objects-normal/armv7/Binary /GTMAppAuth
Undefined symbols for architecture armv7: "_GTMBridgeAssertValidSelector", referenced from: -[GTMAppAuthFetcherAuthorization authorizeRequest:delegate:didFinishSelector:] inGTMAppAuthFetcherAuthorization.o ld:未找到架构 armv7 的符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
pubspec.yaml
dependencies:
flutter:
sdk: flutter
google_sign_in: ^5.0.4
颤抖的医生
[✓] Flutter (Channel stable, 2.2.2, on Mac OS X 10.15.6 19G2021 darwin-x64, locale en) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] Connected device (1 available)
吊舱安装
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
firebase_storage: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
Downloading dependencies
Installing AgoraRtcEngine_iOS (3.3.2)
Installing AppAuth (1.4.0)
Installing BoringSSL-GRPC (0.0.7)
Installing FBSDKCoreKit (11.0.1)
Installing FBSDKCoreKit_Basics (11.0.1)
Installing FBSDKLoginKit (11.0.1)
Installing FMDB (2.7.5)
Installing Firebase (8.0.0)
Installing FirebaseAuth (8.0.0)
Installing FirebaseCore (8.0.0)
Installing FirebaseCoreDiagnostics (8.2.0)
Installing FirebaseFirestore (8.0.0)
Installing FirebaseInstallations (8.2.0)
Installing FirebaseMessaging (8.0.0)
Installing FirebaseStorage (8.0.0)
Installing Flutter (1.0.0)
Installing GTMAppAuth (1.2.2)
Installing GTMSessionFetcher (1.6.0)
Installing Google-Mobile-Ads-SDK (8.5.0)
Installing GoogleAppMeasurement (8.2.0)
Installing GoogleDataTransport (9.0.1)
Installing GoogleSignIn (5.0.2)
Installing GoogleUserMessagingPlatform (2.0.0)
Installing GoogleUtilities (7.4.1)
Installing PromisesObjC (1.2.12)
Installing Toast (4.0.0)
Installing VoxImplantSDK (2.36.2)
Installing VoxImplantWebRTC (78.5.1)
Installing abseil (0.20200225.0)
Installing agora_rtc_engine (3.3.3)
Installing app_tracking_transparency (0.0.1)
Installing assets_audio_player (0.0.1)
Installing assets_audio_player_web (0.0.1)
Installing audioplayers (0.0.1)
Installing cloud_firestore (2.3.0)
Installing firebase_auth (1.4.1)
Installing firebase_core (1.3.0)
Installing firebase_messaging (10.0.3)
Installing firebase_storage (8.1.3)
Installing flutter_facebook_auth (2.0.0)
Installing flutter_local_notifications (0.0.1)
Installing flutter_notification_channel (0.0.1)
Installing flutter_voximplant (3.0.0)
Installing fluttertoast (0.0.2)
Installing gRPC-C++ (1.28.2)
Installing gRPC-Core (1.28.2)
Installing google_mobile_ads (0.0.1)
Installing google_sign_in (0.0.1)
Installing image_picker (0.0.1)
Installing in_app_purchase (0.0.1)
Installing leveldb-library (1.22.1)
Installing minimize_app (0.0.1)
Installing nanopb (2.30908.0)
Installing path_provider (0.0.1)
Installing permission_handler (5.1.0+2)
Installing record_mp3 (0.0.1)
Installing shared_preferences (0.0.1)
Installing sqflite (0.0.2)
Installing video_player (0.0.1)
Installing wakelock (0.0.1)
Generating Pods project
Integrating client project
Pod installation complete! There are 30 dependencies from the Podfile and 60 total pods installed.
【问题讨论】:
-
尝试手动删除 pod 文件和 podlock 文件然后运行应用程序,让我知道结果以获得进一步帮助。
-
我已经删除了pod文件和podlock文件,然后flutter clean,pod install。但未能构建同样的问题。
-
您是否为 iOS 正确配置了 google_sign_in?如果还没有,请参考这里:pub.dev/packages/google_sign_in#ios-integration
-
是的。我已经根据 iOS 集成指南从第 1 步到第 7 步( GoogleService-Info.plist 和 Info.plist )对其进行了配置。我也为 sign_in_with_apple 配置了它。但也未能构建相同的问题(未定义符号:_GTMBridgeAssetValidSelector)。它适用于 Flutter 稳定版 1.22 和 firebase 旧版本包。
-
您是否在 Firebase 身份验证方法部分启用了 google 登录?