Error: Program type already present: org.intellij.lang.annotations.JdkConstants$PatternFlags 3

Viewed 2579

I'm still stuck with this error. I deleted the build folder, the .gradle Folder and the gradle folder. Still the same error when building. I run out of ideas what I could try. This is my current build.gradle (app level)

apply plugin: 'com.android.application'

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

android {
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }

    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId 'ch.workouttracker'
        minSdkVersion 24
        targetSdkVersion 28
        multiDexEnabled true
        versionCode 1
        versionName "0.5"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        resConfigs "de" // And any other languages you support
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions{
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/DEPENDENCIES'

    }
    defaultConfig {
        vectorDrawables.useSupportLibrary = true

    }
    productFlavors {
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}


allprojects {
    repositories {
        maven { url = "https://maven.fabric.io/public" }
    }
}

dependencies {

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //Firebase
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.firebase:firebase-auth:16.1.0'
    implementation 'com.google.firebase:firebase-database:16.0.5'
    implementation 'com.google.firebase:firebase-storage:16.0.5'
    //Graphview
    implementation 'com.jjoe64:graphview:4.2.1'
    implementation 'org.apache.commons:commons-lang3:3.4'
    //Google Play
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.android.gms:play-services-maps:16.0.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.android.gms:play-services-identity:16.0.0'
    //FirebaseUI
    implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
    implementation 'com.firebaseui:firebase-ui-storage:1.2.0'
    implementation 'com.facebook.android:facebook-android-sdk:4.27.0'
    implementation 'com.twitter.sdk.android:twitter-core:3.1.1'
    //Support
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:support-core-utils:27.1.1'
    implementation 'com.android.support:support-media-compat:27.1.1 '
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:gridlayout-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:preference-v7:27.1.1'
    //Firebase
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
    implementation 'com.google.firebase:firebase-plugins:1.1.5'
    implementation 'com.android.support:multidex:1.0.3'
}

apply plugin: 'com.google.gms.google-services'

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

Do you have any ideas what I could try next? Any idea is welcome, I have no clue what else I could try. I keep developing, but I can't build it anymore, which makes it quit hard.

3 Answers

I don't really know what's the problem. I tried to search on google finding few solutions.

Only thing I came up with is please add the following line in your App level build.gradle.

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

Hope that will be helpful. I'm waiting for your answer.

Your error is org.intellij.lang.annotations.JdkConstants$PatternFlags 3 Ask Question

Maybe you can use this

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

With this pice of code i could fix the problem.

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

Related