程序类型已经存在:org.intellij.lang.annotations.Flow [英] Program type already present: org.intellij.lang.annotations.Flow

查看:22
本文介绍了程序类型已经存在:org.intellij.lang.annotations.Flow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试在 Kotlin 中运行程序时都会收到此错误.我的gradle文件是这样的:Project Level Gradle

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 = '1.2.30'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:3.2.0'
    }
}
allprojects {
    repositories {
        google()
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

和应用级 Gradle

And App Level Gradle

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'
ext.supportLibraryVersion = '27.1.1'
ext.playServices = '11.6.2'
android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.rossa.rossa"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.0.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    repositories {
        jcenter()
        maven { url 'https://jitpack.io' }
        mavenCentral()
        google()
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
    implementation "com.android.support:design:$supportLibraryVersion"
    implementation "com.android.support:cardview-v7:$supportLibraryVersion"
    implementation 'com.jakewharton.timber:timber:4.6.1'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.okhttp3:okhttp:3.9.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
    implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
    implementation 'com.appolica:flubber:1.0.1'
    implementation 'org.greenrobot:eventbus:3.1.1'
    implementation 'com.github.daniel-stoneuk:material-about-library:2.2.3-support26.1.0'
}

每当我尝试运行程序时,我都会收到此错误

Whenever I try to run the program I get this error

程序类型已经存在:org.intellij.lang.annotations.Flow Message{kind=ERROR, text=程序类型已经存在:org.intellij.lang.annotations.Flow, sources=[未知源文件],工具名称=Optional.of(D8)}

Program type already present: org.intellij.lang.annotations.Flow Message{kind=ERROR, text=Program type already present: org.intellij.lang.annotations.Flow, sources=[Unknown source file], tool name=Optional.of(D8)}

推荐答案

请在您的 App 级别 build.gradle 中添加以下行.

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

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

这篇关于程序类型已经存在:org.intellij.lang.annotations.Flow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆