"fatal error: 'vector' file not found" while xcode tflite building

"fatal error: 'vector' file not found" while xcode tflite building

我正在开发一个带有 flutter 的 ios 应用程序,我在构建 tflite 模块时遇到了一个 xcode 构建错误

Xcode's output: ↳ === BUILD TARGET Runner OF PROJECT Runner WITH
 CONFIGURATION Debug === While building module 'tflite' imported
 from /test_app/ios/Runner/GeneratedPluginRegistrant.m:8:
 In file included from <module-includes>:1: In file included
 from /app/build/ios/Debug-iphoneos/tflite/tflite.framework/Headers
/tflite-umbrella.h:13: /test_app/build/ios/Debug-iphoneos/tflite
/tflite.framework/Headers/ios_image_load.h:1:10: fatal error: 'vector'
 file not found #include <vector> ^~~~~~~~ 1 error generated.
 /test_app/ios/Runner/GeneratedPluginRegistrant.m:8:9:
 fatal error: could not build module 'tflite' 
#import <tflite/TflitePlugin.h> ~~~~~~~^ 2 errors generated.

我从 github 问题中找到了答案:

在Xcode中打开ios/Runner.xcworkspace,点击Runner > Tagets > Runner > Build Settings,搜索Compile Sources As,将值改为Objective-C++

感谢沙谦https://github.com/shaqian/flutter_tflite/issues/7#issuecomment-440128884