Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TransformException duplicate entry for org/intellij/lang/annotations/Identifier.class

I am getting this error

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: 
duplicate entry: org/intellij/lang/annotations/Identifier.class

It started after I added compile "com.wefika:flowlayout:0.4.0" to my gradle

This is my gradle file

 packagingOptions {
    exclude 'META-INF/NOTICE' // will not include NOTICE file
    exclude 'META-INF/LICENSE' // will not include LICENSE file
    // as noted by @Vishnuvathsan you may also need to include
    // variations on the file name. It depends on your dependencies.
    // Some other common variations on notice and license file names
    exclude 'META-INF/notice'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license'
    exclude 'META-INF/license.txt'
}

dexOptions {
    javaMaxHeapSize "4g"
}




dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'

compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.google.android.gms:play-services-location:9.6.1'
compile "com.google.firebase:firebase-messaging:9.0.0"
compile 'com.google.android.gms:play-services-auth:9.6.1'
compile 'com.google.android.gms:play-services-plus:9.6.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.firebase:firebase-client-android:2.5.2'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.android.gms:play-services:9.6.1'
compile 'org.jetbrains:annotations-java5:15.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.firebase:firebase-core:9.4.0'
compile "com.wefika:flowlayout:0.4.0"

configurations.all {
    resolutionStrategy {
        force 'com.android.support:design:23.4.0'
        force 'com.android.support:support-v4:23.4.0'
        force 'com.android.support:appcompat-v7:23.4.0'
    }
}
like image 931
rookieDeveloper Avatar asked Oct 14 '16 09:10

rookieDeveloper


2 Answers

See this issue here, the comments provide the solution https://github.com/blazsolar/FlowLayout/issues/31

Basically, you need to change the dependency to look like:

compile ("com.wefika:flowlayout:<version>") {
    exclude group: 'com.intellij', module: 'annotations'
}
like image 172
Jawnnypoo Avatar answered Nov 15 '22 21:11

Jawnnypoo


Conflict with it:

compile 'org.jetbrains:annotations-java5:15.0'

Because it contains the same annotations as kotlin enter image description here

In my case, I remove it and fix.

Hope it can help you.

like image 27
Lewis Avatar answered Nov 15 '22 21:11

Lewis