gpt4 book ai didi

Flutter speech_recognition 快速构建错误

转载 作者:IT王子 更新时间:2023-10-29 07:03:30 25 4
gpt4 key购买 nike

我在使用 flutter speech_recognition 包时遇到构建错误。立即尝试为 iOS 构建。尚未测试 Android。

我遵循了安装指南。该包似乎在修改 .yaml 文件后加载。我在 MacBook Pro 上使用 Visual Studio IDE。

Launching lib/main.dart on iPhone Xʀ in debug mode...
Xcode build done. 9.8s
Failed to build iOS app
Error output from Xcode build:

** BUILD FAILED **
Xcode's output:

=== BUILD TARGET speech_recognition OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/abcdefg/Development/flutter/.pub-cache/hosted/pub.dartlang.org/speech_recognition-0.3.0+1/ios/Classes/SpeechRecognitionPlugin.m:2:9: fatal error: 'speech_recognition/speech_recognition-Swift.h' file not found
#import <speech_recognition/speech_recognition-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Could not build the application for the simulator.
Error launching application on iPhone Xʀ.

来 self 的开发目录。我可以找到 speech_recognition 目录,但找不到 .h 文件。

abcdefg-MacBook-Pro:Development abcdefg$ !find
find . -name speech_recognition
./learning_fluter/ios/Pods/Target Support Files/speech_recognition
./learning_fluter/ios/Pods/Headers/Public/speech_recognition
./learning_fluter/ios/Pods/Headers/Private/speech_recognition
./learning_fluter/ios/.symlinks/plugins/speech_recognition
./learning_fluter/build/ios/Debug-iphonesimulator/speech_recognition
abcdefg-MacBook-Pro:Development abcdefg$ find . -name speech_recognition-Swift.h
abcdefg-MacBook-Pro:Development abcdefg$

如有任何帮助,我们将不胜感激!

最佳答案

  1. 确保已使用 -i 命令创建项目,如下所示:futter create -i swift [your_project_name]。
  2. 执行此操作后,确认您在运行器的属性中使用 SWIFT_VERSION = 4.2。因为以前的版本可能会导致此错误。
  3. 最后在 podfile 中添加:

    目标“运行者”做

    use_frameworks!

关于Flutter speech_recognition 快速构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55960067/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com