我无法在ios模拟器上使用vs代码来构建ios应用:无法为模拟器构建应用

时间:2020-02-09 07:17:20

标签: ios xcode flutter visual-studio-code ios-simulator

我在Mac上使用vscode构建ios应用时遇到了问题:

launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Xcode build done.                                           16.8s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    /Users/SW-Mac/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/speech_recognition-0.3.0+1/ios/Classes/SwiftSpeechRecognitionPlugin.swift:111:58: error: type 'AVAudioSession.Category' (aka 'NSString') has no member 'record'
        try audioSession.setCategory(AVAudioSession.Category.record, mode: .default)
                                     ~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
    /Users/SW-Mac/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/speech_recognition-0.3.0+1/ios/Classes/SwiftSpeechRecognitionPlugin.swift:111:73: error: type 'String' has no member 'default'
        try audioSession.setCategory(AVAudioSession.Category.record, mode: .default)
                                                                           ~^~~~~~~
    /Users/SW-Mac/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/speech_recognition-0.3.0+1/ios/Classes/SwiftSpeechRecognitionPlugin.swift:112:50: error: type 'AVAudioSession.Mode' (aka 'NSString') has no member 'measurement'
        try audioSession.setMode(AVAudioSession.Mode.measurement)
                                 ~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~
    /Users/SW-Mac/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/speech_recognition-0.3.0+1/ios/Classes/SwiftSpeechRecognitionPlugin.swift:113:22: error: 'setActive(_:options:)' has been renamed to 'setActive(_:with:)'
        try audioSession.setActive(true, options: .notifyOthersOnDeactivation)
                         ^~~~~~~~~       ~~~~~~~
                         setActive       with
    AVFoundation.AVAudioSession:15:15: note: 'setActive(_:options:)' was introduced in Swift 4.2
        open func setActive(_ active: Bool, options: AVAudioSessionSetActiveOptions = []) throws
                  ^
    /Users/SW-Mac/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/speech_recognition-0.3.0+1/ios/Classes/SwiftSpeechRecognitionPlugin.swift:186:15: error: value of type 'AVAudioSession.Category' (aka 'NSString') has no member 'rawValue'
            return input.rawValue
                   ~~~~~ ^~~~~~~~
    note: Using new build system
    note: Planning build
    note: Constructing build description
    warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
Exited (sigterm)

颤抖的医生:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Mac OS X 10.15.2 19C57, locale en-GB)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.42.0)
[✓] Connected device (1 available)

• No issues found!

我不确定该软件包是否有问题(因为它可以很好地构建到android中)或我的flutter安装/配置错误。请帮忙告知。

0 个答案:

没有答案