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

前端 未结 4 955
别跟我提以往
别跟我提以往 2021-01-03 20:17

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 =         


        
相关标签:
4条回答
  • 2021-01-03 20:20

    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.

    0 讨论(0)
  • 2021-01-03 20:28

    For me, it was just a glitch - "Clean project" helped.

    0 讨论(0)
  • 2021-01-03 20:28

    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.

    0 讨论(0)
  • 2021-01-03 20:34

    Please add following line in your App level build.gradle.

    configurations {
        cleanedAnnotations
        compile.exclude group: 'org.jetbrains' , module:'annotations'
    }
    
    0 讨论(0)
提交回复
热议问题