Summary
Error: Default interface methods are only supported starting with Android N (--min-api 24): com.apollographql.apollo.ApolloCall com.apollographql.apollo.ApolloMutationCall.cacheHeaders(com.apollographql.apollo.cache.CacheHeaders)
Description
Hello guys, I'm trying to migrate my project from v1.2.0 to V2.0.0 and my min. API is 21 as usual. After changing the proper dependencies and plugin name, Build was failed and showed this error to me.
I searched many places in announcements or issues, I couldn't find any info about making the min API 24 for any future Android projects.
I have tried to make my min API 24 and it worked correctly but API 21 compatibility is needed for my company project. Could you please explain to me if there is any solution for this? or I have to work with the old version again?
Thanks in advance
Version
2.0.0
Can you try to target java 8 in your android build.gradle file ? https://developer.android.com/studio/write/java8-support
android {
...
// Configure only for each module that uses Java 8
// language features (either in its source code or
// through dependencies).
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// For Kotlin projects
kotlinOptions {
jvmTarget = "1.8"
}
}
Thanks so much @martinbonnin , It worked.
Most helpful comment
Can you try to target java 8 in your android build.gradle file ? https://developer.android.com/studio/write/java8-support