iosswiftxcodefluttertext-to-speech

Flutter_tts doesn't run on iOS


I am trying to write an app that speaks text on flutter using Flutter_tts library, and it works fine for android, but when I try to run it on iOS device I get an error:

 === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    ld: warning: Could not find auto-linked library 'swiftDispatch'
    ld: warning: Could not find auto-linked library 'swiftCoreMedia'
    ld: warning: Could not find auto-linked library 'swiftAVFoundation'
    ld: warning: Could not find auto-linked library 'swiftFoundation'
    ld: warning: Could not find auto-linked library 'swiftsimd'
    ld: warning: Could not find auto-linked library 'swiftObjectiveC'
    ld: warning: Could not find auto-linked library 'swiftCoreFoundation'
...
I previously switched my build system to legacy build system and specified my "Swift Language Version" to "Swift 4.2"

When I switch my build system to "New Build System" it gives me

Xcode's output:
↳
    error: Multiple commands produce '/Users/dimazhylko/FlutterProjects/flutter_tts_plugin_test/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework':
    1) Target 'Runner' has copy command from '/Users/dimazhylko/FlutterProjects/flutter_tts_plugin_test/ios/Flutter/Flutter.framework' to '/Users/dimazhylko/FlutterProjects/flutter_tts_plugin_test/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework'
    2) That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
    warning: Not running swift-stdlib-tool: ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES is enabled, but the product type 'com.apple.product-type.library.static' is not a wrapper type. (in target 'Pods-Runner')
    warning: ignoring duplicated output file: '/Users/dimazhylko/FlutterProjects/flutter_tts_plugin_test/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework' (in target 'Runner')
    note: Using new build systemnote: Planning buildnote: Constructing build description

Downgrading Swift version doesn't help too.

What else can I try to solve this problem? Or maybe you can recommend another library?(I tried Tts already and it doesn't looks like good choice because it works only on flutter v"0.5.0"(Dart version 2.0.0<)

I also get this warning when I open Xcode


Solution

  • This is a known issue when creating your flutter project without the -i swift flag. I outlined it here similar issue

    flutter create -i swift my_app
    

    As a horrible work around, you can create a new flutter project with the -i swift flag and copy your files over from your current project.