csdcorp / speech_to_text

A Flutter plugin that exposes device specific text to speech recognition capability.
BSD 3-Clause "New" or "Revised" License
348 stars 217 forks source link

Failed to build iOS app, Swift Compiler Error (Xcode): Cannot call value of non-function type 'AVAudioSession.RecordPermission' #475

Closed Jeremy-JM closed 3 months ago

Jeremy-JM commented 3 months ago

I couldn't add this library to any project on my Mac, if I run the flutter pub add speech_to_text, it will show the below error when I start running a project.

I can run the example App on my Mac last month, But now I can't run it as below compiler error:

Launching lib/main.dart on iPhone 15 in debug mode...
main.dart:1
Xcode build done.                                            7.9s
Failed to build iOS app
Swift Compiler Error (Xcode): Cannot call value of non-function type 'AVAudioSession.RecordPermission'
/Users/xxx/.pub-cache/hosted/pub.dev/speech_to_text-6.5.1/ios/Classes/SwiftSpeechToTextPlugin.swift:152:26

Swift Compiler Error (Xcode): Cannot convert value of type 'String' to expected argument type 'AVAudioSession.Category'
/Users/xxx/.pub-cache/hosted/pub.dev/speech_to_text-6.5.1/ios/Classes/SwiftSpeechToTextPlugin.swift:329:74

Swift Compiler Error (Xcode): Cannot convert value of type 'AVAudioSession.Category' to type 'String' in coercion
/Users/xxx/.pub-cache/hosted/pub.dev/speech_to_text-6.5.1/ios/Classes/SwiftSpeechToTextPlugin.swift:329:50

Swift Compiler Error (Xcode): 'setActive(_:with:)' has been renamed to 'setActive(_:options:)'
/Users/xxx/.pub-cache/hosted/pub.dev/speech_to_text-6.5.1/ios/Classes/SwiftSpeechToTextPlugin.swift:336:34

Swift Compiler Error (Xcode): 'setActive(_:with:)' has been renamed to 'setActive(_:options:)'
/Users/xxx/.pub-cache/hosted/pub.dev/speech_to_text-6.5.1/ios/Classes/SwiftSpeechToTextPlugin.swift:382:34

Could not build the application for the simulator.
Error launching application on iPhone 15.
Exited (1)
➜  voice_to_text flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.7, on macOS 14.1.2 23B92 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.85.1)
[✓] Connected device (5 available)
[✓] Network resources

• No issues found!
➜  voice_to_text flutter --version
Flutter 3.16.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ef1af02aea (4 days ago) • 2024-01-11 15:19:26 -0600
Engine • revision 4a585b7929
Tools • Dart 3.2.4 • DevTools 2.28.5

image

sowens-csd commented 3 months ago

Does the example app still build successfully for you?