Kotlin / kotlinx.coroutines

Library support for Kotlin coroutines
Apache License 2.0
13.02k stars 1.85k forks source link

coroutine 0.25.0 gradle compile error "Program type already present: kotlinx.coroutines.experimental.scheduling.LimitingDispatcher" #520

Closed EasonLiu09 closed 6 years ago

EasonLiu09 commented 6 years ago

Hi, I cannot compile while I use coroutine version 0.25.0 but when I change it to 0.23.4 it work ! I find no answer about this problem, is it because only happen in 0.25.0? why this problem happens when compile coroutine 0.25.0

below is my gradle and error kotlin_version is 1.2.61

2018-08-28 11 26 02 2018-08-28 11 27 37 2018-08-28 11 27 56

thanks for reading this problem

Fover23 commented 6 years ago

emmm. I hava the same problem.

My kotlin version is 1.2.61 Android Studio version is 3.1.4 Platform is Windows 10

My gradle configuration is:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/main.kotlin_module'
    }
    compileSdkVersion 28
    defaultConfig {
        applicationId "cn.fover.xxx"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:design:28.0.0-rc01'
    implementation 'com.android.support:support-vector-drawable:28.0.0-rc01'
    implementation 'com.android.support:support-v4:28.0.0-rc01'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation "android.arch.persistence.room:runtime:1.1.1"
    implementation 'cn.aigestudio.wheelpicker:WheelPicker:1.1.2'
    implementation 'joda-time:joda-time:2.10'
    implementation 'me.jessyan:autosize:0.7.0'

    implementation 'android.arch.persistence.room:runtime:1.1.1'
    annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:0.25.0'
}

Build error

default

EasonLiu09 commented 6 years ago

Hi @Fover23 Have you find out any solution about this problem?

Fover23 commented 6 years ago

@EasonLiu09 No. I try to fix it by regular way , such as restart studio or clean project , it does not work. So I change it to old version.

EasonLiu09 commented 6 years ago

@Fover23 yeah me too, it's kinda weird

GeoffreyMetais commented 6 years ago

This is a duplicate of issue #510

EasonLiu09 commented 6 years ago

ok, i will close it