I had to enable Java 8 Support after updating to Android Studio 3.5
Add the following lines in your build.gradle file:
android {
defaultConfig {
...
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
You can check the documentation here:
https://developer.android.com/studio/write/java8-support