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

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

更新 org.tensorflow:tensorflow-lite-metadataorg.tensorflow:tensorflow-lite-task-visionorg.tensorflow:tensorflow-lite-support 应用后出现错误:

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)

有什么问题吗?我在变更日志中找不到任何重大更改。

如果您使用的是 Android Studio ML Binding,它尚未升级到 tflite-support 0.4。您应该继续使用 tflite-support 0.3.1.

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