I am getting this error whenever I try to run a program in Kotlin. My gradle files are like this: Project Level Gradle
buildscript {
ext.kotlin_version =
Excluding the jetbrains
annotations module is a workaround; why is it in your project in the first place? Most likely, it got automatically added to your classpath by Android Studio when what you really wanted was Android's own annotations.
So, a better solution is to look for an org.jetbrains:annotations
dependency in your build.gradle file[s], like this:
implementation 'org.jetbrains:annotations-java5:15.0'
...and remove it.
For me, it was just a glitch - "Clean project" helped.
Program type already present:
org.intellij.lang.annotations.JdkConstants$PatternFlags
Learn how to resolve the issue at: https://developer.android.com/studio/build/dependencies#duplicate_classes.
Please add following line in your App level build.gradle.
configurations {
cleanedAnnotations
compile.exclude group: 'org.jetbrains' , module:'annotations'
}