Error:Jack is required to support java 8 language features [duplicate]

Error:Jack is required to support java 8 language features. Either enable Jack or remove sourceCompatibility JavaVersion.VERSION_1_8.

The error say that you have to enable Jack.

To enable support for Java 8 in your Android project, you need to configure your build.gradle file like that

android {
  ...


  compileSdkVersion 23
  buildToolsVersion "24rc2"
  defaultConfig {
  ...
    jackOptions {
      enabled true
    }
  }

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}