4

I am trying to use retrolambda in my application but I face issues

build.gradle project

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 app

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'.`

any one can help me to fix my issue

thank you

Mina Fawzy
  • 20,852
  • 17
  • 133
  • 156

3 Answers3

5

1.update the Android studio to 2.1 or higher version; 2.delete the "apply plugin: 'me.tatarka.retrolambda'" Try it!

StephenYang
  • 59
  • 1
  • 4
1

removing the lines apply plugin: 'me.tatarka.retrolambda' worked for me.

Neeraj
  • 499
  • 8
  • 16
0

Might stick to retrolambda. Some discussions on jack can be found here