shaqian / flutter_tflite

Flutter plugin for TensorFlow Lite
https://pub.dartlang.org/packages/tflite
MIT License
628 stars 401 forks source link

could not build module 'tflite' #import <tflite/TflitePlugin.h> #136

Open thongvo109 opened 3 years ago

thongvo109 commented 3 years ago

Hi. I have this error after import tflite: ^1.1.1 Flutter version stable 1.17.3. Please help me :(

While building module 'tflite' imported from /Users/thong_vo/AndroidStudioProjects/person/measure/ios/Runner/GeneratedPluginRegistrant.m:74: In file included from :1: In file included from /Users/thong_vo/AndroidStudioProjects/person/measure/build/ios/Debug-iphonesimulator/tflite/tflite.framework/Headers/tflite-umbrella.h:13: /Users/thong_vo/AndroidStudioProjects/person/measure/build/ios/Debug-iphonesimulator/tflite/tflite.framework/Headers/ios_image_load.h:1:10: fatal error: 'vector' file not found

include

         ^~~~~~~~
1 error generated.
/Users/thong_vo/AndroidStudioProjects/person/measure/ios/Runner/GeneratedPluginRegistrant.m:74:9: fatal error: could not build module 'tflite'
#import <tflite/TflitePlugin.h>
shaqian commented 3 years ago

Please try the following: Open ios/Runner.xcworkspace in Xcode, click Runner > Tagets > Runner > Build Settings, search Compile Sources As, change the value to Objective-C++.

thongvo109 commented 3 years ago

Please try the following: Open ios/Runner.xcworkspace in Xcode, click Runner > Tagets > Runner > Build Settings, search Compile Sources As, change the value to Objective-C++.

Thanks it work <3

JoseGeorges8 commented 3 years ago

Is there other workarounds for this? why is this not in the readme? other plugins in my project fail if I make this change

edit: nevermind it is in the readme...