I'm having these issues when I try to use the latest ButterKnife library in my project. I tried many different solution to no avail. But after removing Butterknife, it works and I was able to build my project successfully.
Static interface methods are only supported starting with Android N (--min-api 24): void butterknife.Unbinder.lambda$static$0() | Â
Invoke-customs are only supported starting with Android O (--min-api 26) | Â
null | Â
com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\***\.gradle\caches\transforms-1\files-1.1\butterknife-runtime-9.0.0-rc2.aar\6ce172ce87edce90d1ef858835ddb42a\jars\classes.jar | Â
com.android.builder.dexing.DexArchiveBuilderException: Error while dexing. | Â
com.android.tools.r8.CompilationFailedException: Compilation failed to complete | Â
com.android.tools.r8.utils.AbortException | Â
Per the release notes, all artifacts are now built with Java 8 and reauire you to use Java 8 on the consuming side.
@JakeWharton so does this mean that even though we're not using Java 8 (we use Java 7 + Kotlin JDK7, minApi 21), we'll need to add a desugaring step (which takes minutes), if we want to continue using Butterknife?
Desugaring lives inside D8 as of AGP 3.2 and newer and it does not take
minutes. In fact, D8 with desugaring is faster than dx without desugaring.
Otherwise yes!
On Thu, Jan 17, 2019 at 6:41 AM Róbert Papp (TWiStErRob) <
[email protected]> wrote:
@JakeWharton https://github.com/JakeWharton so does this mean that even
though we're not using Java 8 (we use Java 7 + Kotlin JDK7, minApi 21),
we'll need to add a desugaring step (which takes minutes), if we want to
continue using Butterknife?—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/JakeWharton/butterknife/issues/1416#issuecomment-455142626,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEEESDXu7sDNVAlnCAi-xnA948yMSrTks5vEGFOgaJpZM4ZAMWE
.
Hmm, that sounds promising, thanks!
@TWiStErRob read this article right here: https://developer.android.com/studio/write/java8-support
I had the exact same problem because I didn't know about the new changes in the Android Gradle Plugin like desugaring of Java 8 features.
Look especially at the section where it says "To start using supported Java 8 language features..."
@kyay yes, I saw that page previously, but note "Figure 1" showing a separate desugar step. That means a separate Gradle task, and when we previously enabled it, there was one, which took minutes to run on our project (without using any Java 8 specifics, just Java 7 compiled as 8). But as Jake said, there's no such task any more, desugar is part of dex transform in D8 now. Still seems to slow down a tiny bit, but not significant.
Btw, a sidenote: I only changed target to Java 8, source stayed Java 7, because there's no point making effort to use Java 8 features, while we're migrating to Kotlin anyway.
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
just add this to build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

Jefh15 si me funcionó. Gracias
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
it worked for me Thanks guys
Works great thanks
Most helpful comment
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}