无法在 IOS 移动设备上 运行 我的 flutter 项目

Cant run my flutter project on IOS mobile device

我在 mac 上 运行 时遇到此类错误。这是为什么?我该如何解决?

它在我的 windows 设备上工作。但无法在装有 Apple 8 移动模拟器的 mac 设备上 运行。

这是我得到的错误输出的一部分。



Error output from Xcode build:
↳
    2020-10-30 18:35:20.270 xcodebuild[34710:1305315] /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-17222/XCSourceControl/Service/XCSourceControlXPCServiceClient.swift: 'com.apple.dt.GitHubHostBuiltInExtension' XPC connection interrupted: <NSXPCConnection: 0x7fae93c82520> connection to service on pid 0 named com.apple.dt.GitHubHostBuiltInExtension
    * BUILD FAILED *


Xcode's output:
↳
    In file included from /Users/Chamod/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_call_kit-0.0.2/ios/Classes/FlutterCallKitPlugin.m:1:
    /Users/Chamod/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_call_kit-0.0.2/ios/Classes/FlutterCallKitPlugin.h:7:48: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    @property (nonatomic, strong) CXCallController *callKitCallController;
                                                   ^
    /Users/Chamod/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_call_kit-0.0.2/ios/Classes/FlutterCallKitPlugin.h:7:48: note: insert '_Nullable' if the pointer may be null
    @property (nonatomic, strong) CXCallController *callKitCallController;
                                                   ^
                                                     _Nullable 
    /Users/Chamod/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_call_kit-0.0.2/ios/Classes/FlutterCallKitPlugin.h:7:48: note: insert '_Nonnull' if the pointer should never be null
    @property (nonatomic, strong) CXCallController *callKitCallController;
                                                   ^
                                                     _Nonnull 
    /Users/Chamod/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_call_kit-0.0.2/ios/Classes/FlutterCallKitPlugin.m:3:2: warning: missing submodule 'AVFoundation.AVAudioSession' [-Wincomplete-umbrella]
    #import <AVFoundation/AVAudioSession.h>
     ^      ~
    /Users/Chamod/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_call_kit-0.0.2/ios/Classes/FlutterCallKitPlugin.m:414:88: warning: conflicting parameter types in implementation of 'application:continueUserActivity:restorationHandler:': 'void (^ Nonnull __strong)(NSArray * _Nonnull __strong)' vs 'void (^strong _Nonnull)(NSArray<id<UIUserActivityRestoring>> *_strong)' [-Wmismatched-parameter-types]
     restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> *restorableObjects))restorationHandler
                         ~~~~~~~~~~~~~~~~~~~~~~~ ^
    In module 'Flutter' imported from /Users/Chamod/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_call_kit-0.0.2/ios/Classes/FlutterCallKitPlugin.h:1:
    /Users/Chamod/Documents/Flutter/iMedirepMobile/IMediRep-Mobile/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:164:46: note: previous definition is here
          restorationHandler:(void (^)(NSArray*))restorationHandler;
                              ~~~            ^
    /Users/Chamod/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_call_kit-0.0.2/ios/Classes/FlutterCallKitPlugin.m:6:18: warning: unused variable 'OUTGOING_CALL_WAKEUP_DELAY' [-Wunused-const-variable]
    static int const OUTGOING_CALL_WAKEUP_DELAY = 10;
                     ^
    4 warnings generated.
    /Users/Chamod/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/twilio_programmable_video-0.5.0+4/ios/Classes/BaseListener.swift:9:30: warning: conditional downcast from 'Error?' to 'NSError' is a bridging conversion; did you mean to use 'as'?
            if let error = error as? NSError {
                           ~~ ^~ ~~~
                                 as         ?
    error: the following command failed with exit code 0 but produced no further output
    CompileC /Users/Chamod/Library/Developer/Xcode/DerivedData/Runner-ctvvdwhataikwxblghqfmmwlsgob/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/flutter_local_notifications.build/Objects-normal/x86_64/FlutterLocalNotificationsPlugin.o /Users/Chamod/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-1.5.0+1/ios/Classes/FlutterLocalNotificationsPlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    /Users/Chamod/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.0.1+1/ios/Classes/PermissionManager.m:69:59: warning: 'openURL:' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
            BOOL success = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
                                                              ^~~
                                                              openURL:options:completionHandler:
    In module 'UIKit' imported from /Users/Chamod/Documents/Flutter/iMedirepMobile/IMediRep-Mobile/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:123:1: note: 'openURL:' has been explicitly marked deprecated here
    - (BOOL)openURL:(NSURL*)url API_DEPRECATED_WITH_REPLACEMENT("openURL:options:completionHandler:", ios(2.0, 10.0)) NS_EXTENSION_UNAVAILABLE_IOS("");
    ^
                    ~~~~~~~ ^  ~~~~~
    1 warning generated.
    ../../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/modal_bottom_sheet-0.2.2/lib/src/material_with_modal_page_route.dart:21:16: Error: Getter not found: 'opaque'.
            assert(opaque),
                   ^^^^^^

    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 8 Plus.

需要帮助运行解决这个问题

  1. Keychain Access -> 右键登录 -> 锁定&解锁
  2. Xcode -> 清理 xcode 项目 -> 重新构建

编辑:类似线程: