tflite_flutter_plugin icon indicating copy to clipboard operation
tflite_flutter_plugin copied to clipboard

Framework not found

Open abahnj opened this issue 3 years ago • 28 comments
trafficstars

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?

abahnj avatar Nov 30 '21 18:11 abahnj

Same issues

Screen Shot 2021-12-01 at 17 54 03

AliuDardan avatar Dec 01 '21 16:12 AliuDardan

same, tried everything

DennisKragekjaer avatar Dec 01 '21 20:12 DennisKragekjaer

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

AliuDardan avatar Dec 02 '21 09:12 AliuDardan

Unfortunately does not work for me.

Mmisiek avatar Dec 10 '21 19:12 Mmisiek

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 avatar Dec 10 '21 19:12 Mmisiek

@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

physxP avatar Jan 05 '22 21:01 physxP

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

Worked this for me on MacBook M1 tested on 2022 Feb. !! Thanks a lot!!!

asirigawesha avatar Feb 19 '22 06:02 asirigawesha

TensorFlowLiteC.framework

Where do I find this framework? @AliuDardan @asirigawesha

meet7-sagar23 avatar Jul 08 '22 08:07 meet7-sagar23

TensorFlowLiteC.framework

Where do I find this framework? @AliuDardan @asirigawesha

@meet7sagar It can be found on the home page or here

AliuDardan avatar Jul 08 '22 09:07 AliuDardan

Thanks a lot, @AliuDardan. Btw, I am facing a couple of more issues, can you please help me with that as well?

meet7-sagar23 avatar Jul 08 '22 09:07 meet7-sagar23

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? Screen Shot 2022-10-16 at 23 54 29

phu-bc avatar Oct 16 '22 16:10 phu-bc

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

great work, just additional information use command 'pod install' on /ios folder

mazud21 avatar Jan 16 '23 06:01 mazud21

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 :(.

Mmisiek avatar Feb 11 '23 22:02 Mmisiek

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

Worked this for me on MacBook M1 tested on 2022 Feb. !! Thanks a lot!!!

not on M2 :(

Mmisiek avatar Feb 11 '23 22:02 Mmisiek

@Mmisiek have you found any solution to this?

faisalmushtaq007 avatar Feb 22 '23 12:02 faisalmushtaq007

None of them work for me on an M1...

l0rinc avatar Feb 25 '23 22:02 l0rinc

@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

svonidze avatar Apr 06 '23 18:04 svonidze

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? Screen Shot 2023-04-11 at 1 52 52 AM

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?

charlieforward9 avatar Apr 11 '23 05:04 charlieforward9

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.

vishnukvmd avatar Apr 11 '23 06:04 vishnukvmd

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?

charlieforward9 avatar Apr 13 '23 03:04 charlieforward9

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 avatar Apr 13 '23 03:04 vishnukvmd

@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 avatar Apr 13 '23 03:04 charlieforward9

@charlieforward9 could you also confirm that your flutter project is now pointing to this modded version of visualpt?

vishnukvmd avatar Apr 13 '23 03:04 vishnukvmd

@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.

charlieforward9 avatar Apr 13 '23 03:04 charlieforward9

Hey @vishnukvmd , following up on this. Not sure if you missed it or if you're as confused as I am. 🙃

charlieforward9 avatar Apr 13 '23 21:04 charlieforward9

@charlieforward9 could you try specifying the commit ID for the helper plug-in as well within pubspec?

vishnukvmd avatar Apr 13 '23 22:04 vishnukvmd

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.

charlieforward9 avatar Apr 14 '23 00:04 charlieforward9

You can simply add the framework.xcworkspace in "Build Phase" -> Linked binary with libraries. It will work for you guys.

Kushjadiaa avatar May 18 '23 14:05 Kushjadiaa