studio 3.0数据绑定与kotlin循环依赖错误

时间:2017-05-24 03:40:37

标签: android kotlin

我使用gradle classpath 'com.android.tools.build:gradle:3.0.0-alpha1'时遇到错误 像这样:

 Error:Circular dependency between the following tasks:
:app:compileDebugKotlin
+--- :app:dataBindingExportBuildInfoDebug
|    \--- :app:compileDebugKotlin (*)
\--- :app:kaptDebugKotlin
     \--- :app:dataBindingExportBuildInfoDebug (*)
(*) - details omitted (listed previously)

这是我的项目build.gradle:

buildscript {
    ext.kotlin_version = '1.1.2-4'
    ext.support_version = "25.3.1"
    ext.butterknife_version = "8.4.0"
    ext.anko_version = "0.9"
    ext.bugly_upgrade= "1.2.4"

repositories {
    mavenCentral()
    jcenter()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
    allprojects {
        repositories {
            jcenter()
            mavenCentral()
            maven { url "https://jitpack.io" }
            maven {
                url 'https://oss.sonatype.org/content/repositories/snapshots/'
            }
        }

    }

我的模块build.gradle在这里:

    apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.3'
    defaultConfig {
        applicationId "com.guuguo.android.pikacomic"
        minSdkVersion 17
        targetSdkVersion 25
        versionCode 7
        versionName "0.5"
        ndk {
            //设置支持的SO库架构
            abiFilters /*'armeabi',*/ 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
        }
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
        renderscriptTargetApi 20
        renderscriptSupportModeEnabled true

    }
    signingConfigs {
        release {
            keyAlias 'mimi'
            keyPassword 'guuguo123'
            storeFile file('mimi.jks')
            storePassword 'android'
        }
        debug {
            keyAlias 'mimi'
            keyPassword 'guuguo123'
            storeFile file('mimi.jks')
            storePassword 'android'
        }
    }
    buildTypes {
        release {
            debuggable false
            jniDebuggable false
            zipAlignEnabled true
            shrinkResources false
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
        debug {
            debuggable true
            jniDebuggable true
            zipAlignEnabled true
            shrinkResources false
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
    }
    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
    dataBinding {
        enabled = true
    }
}
kapt {
    generateStubs = true
}

dependencies {
    compile project(':androidLib:androidLib')
    compile project(':library')
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:multidex:1.0.1'
    /*support*/
    compile "com.android.support:cardview-v7:$support_version"
    /* Kotlin */
    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    kapt "com.android.databinding:compiler:2.5.0-alpha-preview-02"
    /* RxJava2 */
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
    compile 'io.reactivex.rxjava2:rxjava:2.1.0'
    /* Retrofit */
    compile 'com.squareup.retrofit2:converter-gson:2.3.0'
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'

    /*view*/
    compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
    compile 'com.flyco.banner:FlycoBanner_Lib:2.0.2@aar'
    compile ('com.alibaba.android:vlayout:1.0.6@aar') {
        transitive = true
    }

    /*function*/
    compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.12'
    compile 'com.github.bumptech.glide:glide:3.8.0'
    compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'

}

非常感谢!

0 个答案:

没有答案