skip to Main Content

I am new to flutter. I am making an action recognize mobile app. But tflite defense doesn’t work with flutter. Does anyone know a solution?

The plugin tflite uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.

this is the error. anyone can help me plz?

2

Answers


  1. You can use google ml kit for recognize things.

    for example for object detection you can use google_mlkit_object_detection
    and this base on tflite

    this is sample code to Create an instance of tflite_model

    final modelPath = await _getModel('assets/ml/object_labeler.tflite');
     final options = LocalObjectDetectorOptions(
      modelPath: modelPath,
      classifyObjects: true,
      multipleObjects: true,
     );
    final objectDetector = ObjectDetector(options: options);
    
    Login or Signup to reply.
  2. change the compile to api you will find a file in this location in windows

    screenshot shows changes

    C:Usersyour_usernameAppDataLocalPubCachehostedpub.devtflite-
    1.1.2androidbuild.gradle
    

    or you can use the relative path

    %AppData%LocalPubCachehostedpub.devtflite-1.1.2androidbuild.gradle
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search