am15h / tflite_flutter_plugin

TensorFlow Lite Flutter Plugin
https://pub.dev/packages/tflite_flutter
Apache License 2.0
499 stars 352 forks source link

Error runing Xcode build on Flutter using TensorFlowLite #214

Open Chrisley304 opened 1 year ago

Chrisley304 commented 1 year ago

Hello! I'm new in TensorFlow and I'm creating a simple object detection app on Flutter using the TensorFlowLite library. After finishing all the Flutter Code, I'm trying to debug it on a iOS Simulator and I'm stuck with the following error:

Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/13/q8h3_c012wvc3mxcfpzrf6fr0000gn/T/flutter_tools.8a658a/flutter_ios_build_temp_dirNlQoAO/temporary_xcresult_bundle
/Users/chrisley/terminal-addons/flutter/.pub-cache/hosted/pub.dartlang.org/tflite-1.1.2/ios/Classes/TflitePlugin.mm:20:9: fatal error: 'TensorFlowLiteC.h' file not found
    #import "TensorFlowLiteC.h"
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    error: the following command failed with exit code 1 but produced no further output
CompileC /Users/chrisley/Library/Developer/Xcode/DerivedData/Runner-eguofderrkwgjseuiagmsjusmxtx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/tflite.build/Objects-normal/arm64/TflitePlugin.o /Users/chrisley/terminal-addons/flutter/.pub-cache/hosted/pub.dartlang.org/tflite-1.1.2/ios/Classes/TflitePlugin.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'tflite' from project 'Pods')
    note: Building targets in dependency order
    /Users/chrisley/Documents/Development/Flutter/tensorflow_test/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'TensorFlowLiteC' from project 'Pods')
    warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    Result bundle written to path:
        /var/folders/13/q8h3_c012wvc3mxcfpzrf6fr0000gn/T/flutter_tools.8a658a/flutter_ios_build_temp_dirNlQoAO/temporary_xcresult_bundle
Lexical or Preprocessor Issue (Xcode): 'TensorFlowLiteC.h' file not found
/Users/chrisley/terminal-addons/flutter/.pub-cache/hosted/pub.dartlang.org/tflite-1.1.2/ios/Classes/TflitePlugin.mm:19:8
2

Could not build the application for the simulator.
Error launching application on iPhone 14 Pro Max.

I tried to solve it adding pod 'TensorFlowLiteObjC' in the Podfile but it didn't work. Also I already ran pod install in the iOS folder.

Miko2x commented 1 year ago

Have you try this step?

https://github.com/am15h/tflite_flutter_plugin/wiki/Build-iOS-binaries-with-GPU-delegate

walsha2 commented 1 year ago

Repo is seemingly no longer maintained - please upvote #221