Butterknife: DexArchiveBuilderException (androidX)

Created on 11 Oct 2018  Â·  3Comments  Â·  Source: JakeWharton/butterknife

Hi there!
First at all, thank you very much for your awesome library!

I've migrated to AndroidX and now when I launch my App I have couple of errors with ButterKnife from JavaCompiler:

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/anthony/.gradle/caches/transforms-1/files-1.1/jetified-butterknife-runtime-9.0.0-SNAPSHOT.aar/569bc08afcd3648ae349d40c892ff908/jars/classes.jar

Caused by: com.android.tools.r8.utils.AbortException: Error: Static interface methods are only supported starting with Android N (--min-api 24): void butterknife.Unbinder.lambda$static$0()

Android errors:

AGPBI: {"kind":"error","text":"Invoke-customs are only supported starting with Android O (--min-api 26)","sources":[{}],"tool":"D8"}
com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/anthony/.gradle/caches/transforms-1/files-1.1/jetified-butterknife-runtime-9.0.0-SNAPSHOT.aar/569bc08afcd3648ae349d40c892ff908/jars/classes.jar
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
...

In my Gradle:

implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'

Thank you for your help by advance!

Most helpful comment

Add this to your buid.gradle(app)

android{
   ............
  compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8

    }
   ...................
}

All 3 comments

You need to set your source and target compatibility to Java 8. You can use the 9.0.0-rc1 release if you want something that will build against 7, but the next RC and final release will require Java 8 bytecode use.

Whatever dude. It's better than all the errors and issues with it when Leo
tried. Lol I have been working in your area on a new batch of a new thread
for more than one year. Yes that would be a bit of an issue for the late
response to my account and I will be able to do with my new address. The
only way I could get the best of my life with you and your family's life
with a bunch of people who don't have any other person. 🎃✨

On Oct 11, 2018 6:44 AM, "anthony3444" notifications@github.com wrote:

Hi there!
First at all, thank you very much for your awesome library!

I've migrated to AndroidX and now when I launch my App I have couple of
errors with ButterKnife from JavaCompiler:

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed
to process /Users/anthony/.gradle/caches/transforms-1/files-1.1/
jetified-butterknife-runtime-9.0.0-SNAPSHOT.aar/
569bc08afcd3648ae349d40c892ff908/jars/classes.jar

Caused by: com.android.tools.r8.utils.AbortException: Error: Static
interface methods are only supported starting with Android N (--min-api
24): void butterknife.Unbinder.lambda$static$0()

Android errors:

AGPBI: {"kind":"error","text":"Invoke-customs are only supported starting with Android O (--min-api 26)","sources":[{}],"tool":"D8"}
com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/anthony/.gradle/caches/transforms-1/files-1.1/jetified-butterknife-runtime-9.0.0-SNAPSHOT.aar/569bc08afcd3648ae349d40c892ff908/jars/classes.jar
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
...

In my Gradle:

implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'

Thank you for your help by advance!

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/JakeWharton/butterknife/issues/1386, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AlwojPUJuU1R_UeXM1qGYtHpqqJnlDIPks5ujy8DgaJpZM4XXXDu
.

Add this to your buid.gradle(app)

android{
   ............
  compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8

    }
   ...................
}
Was this page helpful?
0 / 5 - 0 ratings