Error Invoke-customs are only supported starting with android 0 --min-api 26

Viewed 1739

I'm running the latest (at the time of writing) Android studio 3.6.1 and getting this issue. I know a lot of people have asked about this, but the answer which suggests adding the following to build.gradle didn't work for me

compileOptions {
      sourceCompatibility JavaVersion.VERSION_1_8
      targetCompatibility JavaVersion.VERSION_1_8
  }

I was wondering if anyone knows what else can be done?

Thanks

1 Answers

It's very strange solution but could help.

I removed this part from Gradle app level and added it again, and problem solved

android{
...

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

then clean, rebuild and run the app.

Related