Error: Jack must support java 8 language functions. Either enable Jack, or remove the original JavaVersion.VERSION_1_8 compatibility

As indicated on the .android developer website

"The Jack toolchain is deprecated as indicated in this announcement. The project depends on Jack, you must switch to using the Java 8 support built into the default toolchain for Android Studios."

enter image description here

I need to use lambda expressions, so I disabled the connector options, but when I compile my code, I get the following error

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

Below is a screenshot of my build.gradle file

enter image description here

+5
source share
2 answers

Check out the com.android.tools.build:gradle version.

I had the same error. My decision:

  • set com.android.tools.build:gradle:3.0.0-alpha6
  • update kotlin to 1.1.3-2
  • add to google() repositories

I am using AS 3.0 Canary 6.

+13
source

You should do the following:

  • Update your Android Studio to version 3.0.1 .

  • Update your gradle to 'com.android.tools.build: gradle: 3.0.1

  • Make sure buildToolsVersion is at least 26.0.2 .

After that, you can remove the Jack options and use the supported features of Java 8.

+4
source

Source: https://habr.com/ru/post/1269682/


All Articles