Sanjula
Sanjula

Reputation: 3

MissingPluginException in Flutter with tflite

I am trying to use the tflite package in my Flutter app, but I am encountering a MissingPluginException when attempting to load a model. Here are the details:

Flutter Version:

Dependencies:

dependencies:
  flutter:
    sdk: flutter
  tflite: ^1.1.2

Code:

Future<void> loadModel() async {
  try {
    var resultant = await Tflite.loadModel(
      model: "assets/model.tflite",
    );
    print("Result after loading model: $resultant");
  } catch (e) {
    print("Error loading model: $e");
  }
}

Error:

Error loading model: MissingPluginException(No implementation found for method loadModel on channel tflite)

What I Have Tried:

Environment:

Any help would be greatly appreciated!

Upvotes: -1

Views: 79

Answers (1)

gopelkujo
gopelkujo

Reputation: 822

tflite package was not updated since 3 years ago, this error probably because the package is not compatible with the current flutter version. Try tflite_flutter package instead, it was released 55 days ago.

Upvotes: -1

Related Questions