成功
将 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' }
请问我怎么可能做错事?
尝试使用最新版本的 Kaftka 客户端 (2.1.1( 修复它
由于新Android工作室版本中的Kafka支持,它给出了错误,请尝试降级依赖项版本并尝试重建。