如何修复gradle build中的“failed to process kafka-clients-1.1.1.jar”错误

yc0p9oo0  于 2021-06-06  发布在  Kafka
关注(0)|答案(2)|浏览(329)

在成功地将kafka客户端库添加到依赖项之后,当我尝试运行android应用程序时,我遇到了这个错误。

java.lang.RuntimeException: com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/mac/.gradle/caches/modules-2/files-2.1/org.apache.kafka/kafka-clients/1.1.1/5e96463c4ed422dbed979ae1395176a9c676c090/kafka-clients-1.1.1.jar

Caused by: com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/mac/.gradle/caches/modules-2/files-2.1/org.apache.kafka/kafka-clients/1.1.1/5e96463c4ed422dbed979ae1395176a9c676c090/kafka-clients-1.1.1.jar
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.transform(DexArchiveBuilderTransform.java:442)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:239)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:235)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
... 51 more

build.gradle文件的片段如下所示:;

dependencies { implementation 'org.apache.kafka:kafka-clients:1.1.1' }

拜托,我怎么可能做错了?

0kjbasz6

0kjbasz61#

尝试用最新版本的kaftka客户端(2.1.1)修复它

rqmkfv5c

rqmkfv5c2#

它给出了错误,因为Kafka支持在新的androidstudio版本,尝试降级依赖版本,并尝试重建。

相关问题