[Android][Debug] Program type already present: org.intellij.lang.annotations.Identifier

2019. 4. 24. 14:14Programing/Debugging

[Problem]

Program type already present: org.intellij.lang.annotations.Identifier

 

 

[Root Cause]

Normally, it's caused by duplicated between below and some libraries.

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

 

 

[Solution]

https://stackoverflow.com/questions/49811851/program-type-already-present-org-intellij-lang-annotations-flow

configurations {
    cleanedAnnotations
    compile.exclude group: 'org.jetbrains' , module:'annotations'
}
android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    defaultConfig {
        applicationId "com.bareum_sw.newscollector"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            shrinkResources true
        }
    }
    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8
    }

    configurations {
        cleanedAnnotations
        compile.exclude group: 'org.jetbrains' , module:'annotations'
    }
}