flutter_tflite icon indicating copy to clipboard operation
flutter_tflite copied to clipboard

[!] No podspec found for `flutter_tflite` in `.symlinks/plugins/flutter_tflite/ios`

Open adiShinwari opened this issue 2 years ago • 13 comments

[!] No podspec found for flutter_tflite in .symlinks/plugins/flutter_tflite/ios I am getting this error in iOS, in android it is working perfectly. How can i resolve this

adiShinwari avatar Feb 24 '23 07:02 adiShinwari

same here, looks like this project is no more...

LearnWithSherlock avatar Mar 01 '23 02:03 LearnWithSherlock

same here

misterpropik avatar Mar 09 '23 20:03 misterpropik

Same here. Any solution for that?

Orlyga01 avatar May 13 '23 14:05 Orlyga01

any solution? any one !!

hims1008 avatar May 26 '23 10:05 hims1008

switched to this package, works great https://pub.dev/packages/google_ml_kit

misterpropik avatar May 26 '23 11:05 misterpropik

Spend the whole night, Trying to find a solution for this. But no luck :(

FunzoftFlutter avatar Jun 01 '23 06:06 FunzoftFlutter

switched to this package, works great https://pub.dev/packages/google_ml_kit

I tried this package but had difficulties using my own .tflite file

binemmanuel avatar Jul 11 '23 13:07 binemmanuel

@binemmanuel what are the difficulties?

misterpropik avatar Jul 11 '23 14:07 misterpropik

@misterpropik

Exception: PlatformException(ImageLabelDetectorError, com.google.mlkit.common.MlKitException: Failed to initialize detector. Input tensor has type kTfLiteFloat32: it requires specifying NormalizationOptions metadata to preprocess input images., null, null)

My Code

 Future<void> processImage(File file) async {
    final modelPath = await getModel('assets/models/model.tflite');

    final imageLabeler = ImageLabeler(
      options: LocalLabelerOptions(
        modelPath: modelPath,
        confidenceThreshold: 0.5,
      ),
    );

    final labels = await imageLabeler.processImage(InputImage.fromFile(file));

    for (final label in labels) {
      print(label.label);
    }

    return await imageLabeler.close();
  }```

binemmanuel avatar Jul 11 '23 15:07 binemmanuel

@binemmanuel where is this model from (model.tflite) ?

misterpropik avatar Jul 11 '23 16:07 misterpropik

Solution

Add this to your pubspec.yaml

tflite:
      git:
        url: https://github.com/shaqian/flutter_tflite.git

instead of

flutter_tflite: ^1.0.1

Solution

Add this to your pubspec.yaml

tflite:
      git:
        url: https://github.com/shaqian/flutter_tflite.git

instead of

flutter_tflite: ^1.0.1

The next step to using this for me was to sign the app (open ios/Runner.xcworkspace, go into the runner, Signing & Capabilities, and update the Team)... Then after that I'm getting an error Could not build the precompiled application for the device. Lexical or Preprocessor Issue (Xcode): 'TensorFlowLiteC.h' file not found... Hmm... I've been trying a lot of different ML libraries to detect types of food... Does this fix work for anyone else? Is there something I've done wrong or haven't yet done? 🤔

davidd647 avatar Jul 29 '23 22:07 davidd647

Solution Add this to your pubspec.yaml

tflite:
      git:
        url: https://github.com/shaqian/flutter_tflite.git

instead of

flutter_tflite: ^1.0.1

The next step to using this for me was to sign the app (open ios/Runner.xcworkspace, go into the runner, Signing & Capabilities, and update the Team)... Then after that I'm getting an error Could not build the precompiled application for the device. Lexical or Preprocessor Issue (Xcode): 'TensorFlowLiteC.h' file not found... Hmm... I've been trying a lot of different ML libraries to detect types of food... Does this fix work for anyone else? Is there something I've done wrong or haven't yet done? 🤔

@davidd647, I got rid of the error

Could not build the precompiled application for the device. Lexical or Preprocessor Issue (Xcode): 'TensorFlowLiteC.h' file not found

by adding the following line to the Podfile (I got it from here):

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  # add this line
  pod 'TensorFlowLiteC', '2.2.0'

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  target 'RunnerTests' do
    inherit! :search_paths
  end
end

but now I run into the following errors:

  • Semantic Issue (Xcode): Use of undeclared identifier '_tflite_part_names'; did you mean '_tflite_parts_ids'?
  • Semantic Issue (Xcode): Expected method to read array element not found on object of type 'NSMutableDictionary *'
  • Semantic Issue (Xcode): Use of undeclared identifier '_tflite_pose_chain'
  • Semantic Issue (Xcode): Expected method to read array element not found on object of type 'NSMutableDictionary *'
  • Semantic Issue (Xcode): Use of undeclared identifier 'child_to_parent_edges'
  • Semantic Issue (Xcode): Use of undeclared identifier 'parent_to_child_edges'

Did anyone get this to work?

iliosana avatar Mar 28 '24 15:03 iliosana