I'm developping an ios app with flutter and i've come accross a xcode build error while building tflite module
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.
CodePudding user response:
I found an answer from a github issue:
Open ios/Runner.xcworkspace
in Xcode, click Runner > Tagets > Runner > Build Settings
, search Compile Sources As
, change the value to Objective-C
Thanks to shaqian https://github.com/shaqian/flutter_tflite/issues/7#issuecomment-440128884