tensorflow 合并两个应用程序项目时发现获取重复类错误

ubby3x7f  于 2023-10-23  发布在  其他
关注(0)|答案(1)|浏览(148)

合并两个应用程序项目时出错。

Duplicate class org.tensorflow.lite.DataType found in modules jetified-tensorflow-lite-1.13.1-runtime (org.tensorflow:tensorflow-lite:1.13.1) and jetified-tensorflow-lite-api-2.7.0-runtime (org.tensorflow:tensorflow-lite-api:2.7.0)
Duplicate class org.tensorflow.lite.DataType$1 found in modules jetified-tensorflow-lite-1.13.1-runtime (org.tensorflow:tensorflow-lite:1.13.1) and jetified-tensorflow-lite-api-2.7.0-runtime (org.tensorflow:tensorflow-lite-api:2.7.0)
Duplicate class org.tensorflow.lite.Delegate found in modules jetified-tensorflow-lite-1.13.1-runtime (org.tensorflow:tensorflow-lite:1.13.1) and jetified-tensorflow-lite-api-2.7.0-runtime (org.tensorflow:tensorflow-lite-api:2.7.0)
Duplicate class org.tensorflow.lite.Tensor found in modules jetified-tensorflow-lite-1.13.1-runtime (org.tensorflow:tensorflow-lite:1.13.1) and jetified-tensorflow-lite-api-2.7.0-runtime (org.tensorflow:tensorflow-lite-api:2.7.0)

Go to the documentation to learn how to Fix dependency resolution errors.
a64a0gku

a64a0gku1#

嘿,对于我的情况,错误是“Duplicate class org.tensorflow.lite.support.image.ops.TensorOperatorWrapper found in modules jetified-tensorflow-lite-support-0.1.0-runtime (org.tensorflow:tensorflow-lite-support:0.1.0) and jetified-tensorflow-lite-support-api-0.4.4-runtime (org.tensorflow:tensorflow-lite-support-api:0.4.4)
解决方案我在build.gradle中注解了下面的依赖关系,它工作得很好。//implementation 'org.tensorflow:tensorflow-lite-support:0.1.0'
我的意见在你的情况下,你可能需要注解你的依赖之一,它的版本在你收到的错误中提到,如“(org.tensorflow:tensorflow-lite:1.13.1) and jetified-tensorflow-lite-api-2.7.0-runtime (org.tensorflow:tensorflow-lite-api:2.7.0)
完成后,同步并重新构建项目。希望这对您有所帮助。

相关问题