我目前正在将Facebook Login package for Flutter用于正在开发的Flutter应用程序,但是在iO中构建它时遇到了问题。
我已经按照指南中的所有步骤进行操作,并且在Android上运行良好,但是当我尝试在iOs模拟器中运行它时,就会显示此输出
Launching lib/main.dart on iPhone X in debug mode...
Running pod install...
Starting Xcode build...
Xcode build done. 3.0s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
In file included from /Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/AppEvents/FBSDKPaymentObserver.m:23:
In file included from /Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/AppEvents/FBSDKAppEvents+Internal.h:19:
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:33:19: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
FOUNDATION_EXPORT NSNotificationName const FBSDKAppEventsLoggingResultNotification;
^
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:33:19: note: insert '_Nullable' if the pointer may be null
FOUNDATION_EXPORT NSNotificationName const FBSDKAppEventsLoggingResultNotification;
^
_Nullable
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:33:19: note: insert '_Nonnull' if the pointer should never be null
FOUNDATION_EXPORT NSNotificationName const FBSDKAppEventsLoggingResultNotification;
^
_Nonnull
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:700:13: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
+ (NSString *)getUserData;
^
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:700:13: note: insert '_Nullable' if the pointer may be null
+ (NSString *)getUserData;
^
_Nullable
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:700:13: note: insert '_Nonnull' if the pointer should never be null
+ (NSString *)getUserData;
^
_Nonnull
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:714:44: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
+ (void)updateUserProperties:(NSDictionary *)properties handler:(FBSDKGraphRequestHandler)handler;
^
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:714:44: note: insert '_Nullable' if the pointer may be null
+ (void)updateUserProperties:(NSDictionary *)properties handler:(FBSDKGraphRequestHandler)handler;
^
_Nullable
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:714:44: note: insert '_Nonnull' if the pointer should never be null
+ (void)updateUserProperties:(NSDictionary *)properties handler:(FBSDKGraphRequestHandler)handler;
^
_Nonnull
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:714:66: warning: block pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
+ (void)updateUserProperties:(NSDictionary *)properties handler:(FBSDKGraphRequestHandler)handler;
^
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:714:66: note: insert '_Nullable' if the block pointer may be null
+ (void)updateUserProperties:(NSDictionary *)properties handler:(FBSDKGraphRequestHandler)handler;
^
_Nullable
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:714:66: note: insert '_Nonnull' if the block pointer should never be null
+ (void)updateUserProperties:(NSDictionary *)properties handler:(FBSDKGraphRequestHandler)handler;
^
_Nonnull
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:726:43: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
+ (void)augmentHybridWKWebView:(WKWebView *)webView;
^
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:726:43: note: insert '_Nullable' if the pointer may be null
+ (void)augmentHybridWKWebView:(WKWebView *)webView;
^
_Nullable
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h:726:43: note: insert '_Nonnull' if the pointer should never be null
+ (void)augmentHybridWKWebView:(WKWebView *)webView;
^
_Nonnull
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/AppEvents/FBSDKPaymentObserver.m:242:38: error: property 'subscriptionPeriod' not found on object of type 'SKProduct *'
BOOL isSubscription = (product.subscriptionPeriod != nil) && ((unsigned long)product.subscriptionPeriod.numberOfUnits > 0);
^
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/AppEvents/FBSDKPaymentObserver.m:242:92: error: property 'subscriptionPeriod' not found on object of type 'SKProduct *'
BOOL isSubscription = (product.subscriptionPeriod != nil) && ((unsigned long)product.subscriptionPeriod.numberOfUnits > 0);
^
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/AppEvents/FBSDKPaymentObserver.m:248:9: error: use of undeclared identifier 'SKProductSubscriptionPeriod'
SKProductSubscriptionPeriod *period = product.subscriptionPeriod;
^
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/AppEvents/FBSDKPaymentObserver.m:248:38: error: use of undeclared identifier 'period'
SKProductSubscriptionPeriod *period = product.subscriptionPeriod;
^
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/AppEvents/FBSDKPaymentObserver.m:248:55: error: property 'subscriptionPeriod' not found on object of type 'SKProduct *'
SKProductSubscriptionPeriod *period = product.subscriptionPeriod;
^
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/AppEvents/FBSDKPaymentObserver.m:250:17: error: use of undeclared identifier 'period'
switch (period.unit) {
^
/Users/javier/Documents/Android_Studio_Projects/squat_app/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/AppEvents/FBSDKPaymentObserver.m:256:76: error: use of undeclared identifier 'period'
NSString *p = [NSString stringWithFormat:@"P%lu%@", (unsigned long)period.numberOfUnits, unit];
^
5 warnings and 7 errors generated.
Could not build the application for the simulator.
Error launching application on iPhone X.
我在ios文件夹中做了flutter clean
和pod update
,但是一直崩溃。我不知道发生了什么,这不只是我的包装问题。
这是我的flutter doctor -v
[✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.12.6 16G1036, locale en-ES)
• Flutter version 0.9.4 at /Users/javier/Documents/flutter
• Framework revision f37c235c32 (4 weeks ago), 2018-09-25 17:45:40 -0400
• Engine revision 74625aed32
• Dart version 2.1.0-dev.5.0.flutter-a2eb050044
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at /Users/javier/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.0, Build version 9A235
• ios-deploy 1.9.2
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 29.1.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[✓] Connected devices (2 available)
• Mi A1 • 1f95603a0804 • android-arm64 • Android 8.1.0 (API 27)
• iPhone X • 32CD2ECE-8C12-4F3A-B768-E1568B9754A7 • ios • iOS 11.0 (simulator)
如果有人可以帮助我找到这个问题的原因,我将不胜感激,因为我现在已经迷路了。
谢谢!
答案 0 :(得分:0)
看起来问题出在我的Xcode版本上。我更新到9.2,现在可以正常使用了。
这是我的Doctor输出
[✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.12.6 16G1036, locale en-ES)
• Flutter version 0.9.4 at /Users/javier/Documents/flutter
• Framework revision f37c235c32 (4 weeks ago), 2018-09-25 17:45:40 -0400
• Engine revision 74625aed32
• Dart version 2.1.0-dev.5.0.flutter-a2eb050044
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at /Users/javier/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.0, Build version 9A235
• ios-deploy 1.9.2
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 29.1.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[✓] Connected devices (2 available)
• Mi A1 • 1f95603a0804 • android-arm64 • Android 8.1.0 (API 27)
• iPhone X • 32CD2ECE-8C12-4F3A-B768-E1568B9754A7 • ios • iOS 11.0 (simulator)
• No issues found!