I would like to set the Java version I'm using on Android Studio.
How do I set the 'Project language level' like I do on Intellij inside 'Project Structure...' --> 'Project'?
I would like to set the Java version I'm using on Android Studio.
How do I set the 'Project language level' like I do on Intellij inside 'Project Structure...' --> 'Project'?
Sample build.gradle file which allows me to use lambdas in Android Studio 2.1:
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.geniuscreations.successtaskanalyzer"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Add this to your build.gradle(Module:app):
android{
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
...
}