ios - Flutter_tts 无法在 iOS 上运行

标签 ios swift xcode flutter text-to-speech

我正在尝试使用 Flutter_tts 编写一个在 flutter 上朗读文本的应用程序库,它在 Android 上运行良好,但是当我尝试在 iOS 设备上运行它时,出现错误:

 === 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'
...
我之前将构建系统切换为旧版构建系统,并将“Swift 语言版本”指定为“Swift 4.2”

当我将构建系统切换到“新构建系统”时,它给了我

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

降级 Swift 版本也没有帮助。

我还能尝试什么来解决这个问题? 或者也许你可以推荐另一个库?(我已经尝试过 Tts ,它看起来不是一个好的选择,因为它仅适用于 flutter v"0.5.0"(Dart 版本 2.0.0<)

I also get this warning when I open Xcode

最佳答案

这是在不使用 -i swift 标志创建 flutter 项目时的一个已知问题。我在这里概述了similar issue

flutter create -i swift my_app

作为一个可怕的解决方法,您可以使用 -i swift 标志创建一个新的 flutter 项目,并从当前项目复制文件。

关于ios - Flutter_tts 无法在 iOS 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52493409/

相关文章:

ios - NSFetchedResultsController 不诉诸内容更改

iphone - 使用 UIScrollView 以编程方式放大大图片的小区域

ios - 滑动 UIView 时的动画错误

swift - UICollectionView 只显示最后一个单元格

c++ - 我可以在 Xcode 的单个应用程序中混合使用 Objective-C 和 C++ 吗?

ios - 使表格 View 部分快速展开

ios - objective-c : how to get the list of possible values returned by [[NSLocale currentLocale] objectForKey: NSLocaleLanguageCode]?

swift - 自定义 UIButton 导致 Storyboard Agent 崩溃 Swift

ios - UITabBarItem 不更新图像

ios - 信息按钮推到UIViewController