当前位置: 代码迷 >> 综合 >> lambada使用需求
  详细解决方案

lambada使用需求

热度:68   发布时间:2023-10-15 11:12:18.0
1、使用lambada需要在build.gradle里面的andorid根节点下面加入:compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8

    }  

2、添加apply plugin: 'me.tatarka.retrolambda'

3、在工作空间哪里添加lambada依赖

buildscript {repositories {jcenter()}dependencies {classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'me.tatarka:gradle-retrolambda:3.3.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}allprojects {repositories {jcenter()}
}task clean(type: Delete) {delete rootProject.buildDir
}

  相关解决方案