4

我正在尝试在我的应用程序中使用 retrolambda,但我遇到了问题

build.gradle 项目

buildscript {
    repositories {
        jcenter()
        mavenLocal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'me.tatarka:gradle-retrolambda:3.2.5'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenLocal()
    }

}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle 应用程序

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'me.tatarka.retrolambda'


android {
    compileSdkVersion 23
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "psystem.co.reaya"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        jackOptions {
            enabled true
        }

    }
    dexOptions {
        preDexLibraries false
        javaMaxHeapSize "4g"
        incremental true

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.google.code.gson:gson:2.4'
    retrolambdaConfig 'net.orfjackal.retrolambda:retrolambda:+'
    compile 'com.android.support:multidex:1.0.1'
}



my tries to fix the issue remove jack options , I got this error  `org.gradle.execution.TaskSelectionException: Task ',' not found in root project 'Reaya'.`

任何人都可以帮助我解决我的问题

谢谢你

4

3 回答 3

5

1.将Android studio更新到2.1或更高版本;2.删除“应用插件:'me.tatarka.retrolambda'”试试吧!

于 2016-12-19T08:49:36.917 回答
1

删除线条apply plugin: 'me.tatarka.retrolambda'对我有用。

于 2017-03-27T08:37:50.743 回答
0

可能会坚持使用retrolambda。关于杰克的一些讨论可以在这里找到

于 2016-09-10T08:00:59.137 回答