我试图使用zxing来使用android studio扫描条形码 但是当我尝试添加zxing gradle时出现此错误
Error:Execution failed for task ':app:transformClassesWithJarMergingForAristiDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/zxing/BarcodeFormat.class
这就是我所有的gradle
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.google.android.gms:play-services-location:10.2.1'
compile 'com.karumi:dexter:2.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'me.dm7.barcodescanner:zxing:1.9'
testCompile 'junit:junit:4.12'
有人可以告诉我该怎么办?或者我应该搜索什么来删除此错误?
答案 0 :(得分:0)
抱歉,因为我是java的新手,我不知道如何解决这样的简单问题。搜索一周后,我已经找到了如何解决。 问题是我的jar在同一目录中包含相同的类,这就是我收到此错误的原因。在我的情况下,它在我排除导致此
的目录后解决了1