Error:(129, 32) 错误: -source 1.7 中不支持 lambda 表达式

(请使用 -source 8 或更高版本以启用 lambda 表达式)

lambda expressions are not suported at this language level

 

解决方案一:

1:工程的build.gradle中需要写入

dependencies {

classpath 'me.tatarka:gradle-retrolambda:3.2.5'

}

2:app的build.gradle中需要写入

apply plugin: 'me.tatarka.retrolambda'

 

android {

compileOptions {

sourceCompatibility JavaVersion.VERSION_1_8

targetCompatibility JavaVersion.VERSION_1_8

}

}

 

解决方案二:

app的build.gradle中需要写入

android {

......

defaultConfig {

.....

jackOptions {

enabledtrue

}

}

......

//java8 support

compileOptions {

sourceCompatibilityJavaVersion.VERSION_1_8

targetCompatibilityJavaVersion.VERSION_1_8

}

}

 

相关文章:

  • 2022-01-06
  • 2022-01-07
  • 2021-08-10
  • 2021-06-03
  • 2021-08-14
  • 2021-09-15
猜你喜欢
  • 2021-08-13
  • 2021-12-29
  • 2021-12-07
  • 2021-07-19
  • 2022-12-23
  • 2021-10-16
相关资源
相似解决方案