语音语音识别迅速建立错误

时间:2019-05-02 20:51:06

标签: flutter speech-recognition build-error

我使用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ʀ.

从我的dev目录中。我可以找到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 个答案:

答案 0 :(得分:0)

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

    目标“跑步者”要做

    use_frameworks!