tflite_flutter_plugin
tflite_flutter_plugin copied to clipboard
Framework not found
After copying the TensorFlowLiteC framework to the correct location the iOS build still fails with the framework not found error. I can get it to run by copying the framework to the derived data folder of the build and running directly from iOS but that's just a hacky workaround. any suggestions or ideas?
Same issues

same, tried everything
Hi to all
After i spend more then 2 days on this error, i found a solution and I hope will work for others.
Solution:
Framework not found TensorFlowLiteC to fix this issues you need to go to your app folder
flutterAPP/ios/.symlinks/plugins/tflite_flutter/ios and I moved here that TensorFlowLiteC.framework
Flutter clean
Flutter pub get
pod install
Cheers
Unfortunately does not work for me.
After copying the TensorFlowLiteC framework to the correct location the iOS build still fails with the framework not found error. I can get it to run by copying the framework to the derived data folder of the build and running directly from iOS but that's just a hacky workaround. any suggestions or ideas?
Where is derived folder ? I would like to run it even with hack !
@Mmisiek this is the hacky way around: https://github.com/am15h/tflite_flutter_plugin/issues/153#issuecomment-950301547 This also worked for me: https://github.com/am15h/tflite_flutter_plugin/issues/153#issuecomment-1006075443
Hi to all
After i spend more then 2 days on this error, i found a solution and I hope will work for others.
Solution:
Framework not found TensorFlowLiteCto fix this issues you need to go to your app folderflutterAPP/ios/.symlinks/plugins/tflite_flutter/iosand I moved here thatTensorFlowLiteC.framework
Flutter cleanFlutter pub getpod installCheers
Worked this for me on MacBook M1 tested on 2022 Feb. !! Thanks a lot!!!
TensorFlowLiteC.framework
Where do I find this framework? @AliuDardan @asirigawesha
TensorFlowLiteC.framework
Where do I find this framework? @AliuDardan @asirigawesha
@meet7sagar It can be found on the home page or here
Thanks a lot, @AliuDardan. Btw, I am facing a couple of more issues, can you please help me with that as well?
I tried every solutions in this issue but nothing works for me. I am using M1.
This is my current issue. Can anyone help me this case please?

Hi to all
After i spend more then 2 days on this error, i found a solution and I hope will work for others.
Solution:
Framework not found TensorFlowLiteCto fix this issues you need to go to your app folderflutterAPP/ios/.symlinks/plugins/tflite_flutter/iosand I moved here thatTensorFlowLiteC.framework
Flutter cleanFlutter pub getpod installCheers
great work, just additional information use command 'pod install' on /ios folder
So this solution worked on Mac Book Pro Intel but does not on brand new Mac Mini M2 Pro. Any idea why and how to fix it ? Utterly annoying :(.
Hi to all After i spend more then 2 days on this error, i found a solution and I hope will work for others. Solution:
Framework not found TensorFlowLiteCto fix this issues you need to go to your app folderflutterAPP/ios/.symlinks/plugins/tflite_flutter/iosand I moved here thatTensorFlowLiteC.frameworkFlutter cleanFlutter pub getpod installCheersWorked this for me on MacBook M1 tested on 2022 Feb. !! Thanks a lot!!!
not on M2 :(
@Mmisiek have you found any solution to this?
None of them work for me on an M1...
@paplorinc
None of them work for me on an M1...
instead of pod install run arch -x86_64 pod install
also do copy TensorFlowLiteC to .../ios/.symlinks/plugins/tflite_flutter/ios with using the instruction
It can be found on the home page or here
also you may need to tweak Podfile so this code
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
becomes
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'i386 arm64'
end
end
end
I am getting this error when running Xcode Cloud workflow. The .symlinks/ folder is not on Github, where the action is running. Has anyone solved their way around this case?

Here is the code that runs in the workflow prior to the error.
#!/bin/sh
# The default execution directory of this script is the ci_scripts directory.
cd $CI_WORKSPACE # change working directory to the root of your cloned repo.
# Install Flutter using git.
git clone https://github.com/flutter/flutter.git --depth 1 -b stable $HOME/flutter
export PATH="$PATH:$HOME/flutter/bin"
# Install Flutter artifacts for iOS (--ios), or macOS (--macos) platforms.
flutter precache --ios
# Install Flutter dependencies.
flutter pub get
# Install CocoaPods using Homebrew.
HOMEBREW_NO_AUTO_UPDATE=1 # disable homebrew's automatic updates.
HOMEBREW_NO_INSTALL_CLEANUP=1 # speed up build time
brew install cocoapods
# Install CocoaPods dependencies.
cd ios && pod install # run `pod install` in the `ios` directory.
cd ..
exit 0
Is there any way to programmatically hack around this by putting the Framework folder in my repo and using this script to put it in the right place?
Hey @charlieforward9, could you try changing the dependency to github.com/ente-io/tflite_flutter_plugin?
Here the plugin depends on upstream TFLite via Cocoapods, so the Github action might work.
Hey @vishnukvmd, thank you for responding to this. Unfortunately...
When I change my tflite_flutter dependency...
- tflite_flutter: ^0.9.0
+ tflite_flutter:
+ git:
+ url: https://github.com/ente-io/tflite_flutter_plugin.git
+ ref: master
My flutter pub get output was:
Because tflite_flutter_helper >=0.2.1 depends on tflite_flutter from hosted and visualpt depends on tflite_flutter from git, tflite_flutter_helper >=0.2.1 is forbidden. So, because visualpt depends on tflite_flutter_helper ^0.2.1, version solving failed.
I noticed that @ente-io also cloned the helper library, so I replaced that dependency as well and...
Because every version of tflite_flutter_helper from git depends on tflite_flutter from git https://github.com/ente-io/tflite_flutter_plugin at e90a9665a8ccf828d2cca507a1f0904c51e73743 and visualpt depends on tflite_flutter from git https://github.com/ente-io/tflite_flutter_plugin.git at master, tflite_flutter_helper from git is forbidden. So, because visualpt depends on tflite_flutter_helper from git, version solving failed.
Finally, I changed the tflite_flutter ref to e90a9665a8ccf828d2cca507a1f0904c51e73743, but the output remained the same.
What do you suggest?
Hey @charlieforward9, I can't find visualpt on pub.dev. Is it a package you've locally developed? If yes, could you please configure it to use the git version of tflite_flutter as well?
@vishnukvmd VisualPT is my private project that is depending on these libraries. This is the current snippet in the pubspec.yaml
tflite_flutter:
git:
url: https://github.com/ente-io/tflite_flutter_plugin.git
ref: e90a9665a8ccf828d2cca507a1f0904c51e73743
tflite_flutter_helper:
git:
url: https://github.com/ente-io/tflite_flutter_helper.git
ref: master
@charlieforward9 could you also confirm that your flutter project is now pointing to this modded version of visualpt?
@vishnukvmd VisualPT is my Flutter project. I am simply modifying the VisualPT pubspec.yaml and saving the file, which triggers an automatic flutter pub get command.
Hey @vishnukvmd , following up on this. Not sure if you missed it or if you're as confused as I am. 🙃
@charlieforward9 could you try specifying the commit ID for the helper plug-in as well within pubspec?
Tried, and failed, the same message except for the word master is replaced by the commit id.
I am going to try to move forward by removing the inference from my app and running it on a server. If you've got some time to spare, feel free to check and share your take on this conversation I had with ChatGPT about running the models on a server.
You can simply add the framework.xcworkspace in "Build Phase" -> Linked binary with libraries. It will work for you guys.