Search code examples
androidtensorflowtensorflow-lite

`java.lang.NoSuchMethodError: No static method create` after update tensorflow lite to 0.4.0


After updating org.tensorflow:tensorflow-lite-metadata, org.tensorflow:tensorflow-lite-task-vision and org.tensorflow:tensorflow-lite-support app falls with error:

java.lang.NoSuchMethodError: No static method create(Ljava/nio/ByteBuffer;Lorg/tensorflow/lite/InterpreterApi$Options;)Lorg/tensorflow/lite/InterpreterApi; in class Lorg/tensorflow/lite/InterpreterApi; or its super classes (declaration of 'org.tensorflow.lite.InterpreterApi' appears in /data/app/~~iBlhCFEsffVRgKI8jlh50w==/com.po4yka.dancer.debug-dw8TLYwUobxDEHmwOF5CSg==/base.apk!classes2.dex)

What could be wrong? I couldn't find any breaking changes in changelog.


Solution

  • If you're using Android Studio ML Binding, it has not been upgraded to tflite-support 0.4 yet. You should continue using tflite-support 0.3.1.

    See: https://github.com/tensorflow/tflite-support/issues/824