Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Error when included in project with butterknife #55

Open
RoryKelly opened this issue May 28, 2017 · 6 comments
Open

Error when included in project with butterknife #55

RoryKelly opened this issue May 28, 2017 · 6 comments

Comments

@RoryKelly
Copy link

in an app I'm slowly moving over to kotlin in Build.gradle I add in:

 kapt 'com.jakewharton:butterknife-compiler:8.5.1'
  compile 'com.jakewharton:butterknife:8.5.1'
  compile 'com.jakewharton:kotterknife:0.1.0-SNAPSHOT'

When I Build it fails with:

Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lbutterknife/BuildConfig;
Error:com.android.dex.DexException: Multiple dex files define Lbutterknife/BuildConfig;
Error:	at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:608)
Error:	at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:563)
Error:	at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:545)
Error:	at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:167)
Error:	at com.android.dx.merge.DexMerger.merge(DexMerger.java:194)
Error:	at com.android.builder.dexing.DexArchiveMergerCallable.mergeDexes(DexArchiveMergerCallable.java:66)
Error:	at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:54)
Error:	at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:37)
Error:	at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
Error:	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
Error:	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
Error:	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
Error:	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error:Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lbutterknife/BuildConfig;
@g00m
Copy link

g00m commented May 29, 2017

same here but with:

compile 'com.jakewharton:butterknife:8.6.0'
compile 'com.jakewharton:kotterknife:0.1.0-SNAPSHOT'

@addingama
Copy link

I have the same problem with @RoryKelly

really need help

@CodyEngel
Copy link

The error is saying that there are multiple inclusions of Butterknife. Have either of you tried removing butterknife from the dependency?

@RoryKelly
Copy link
Author

Yes Removing the butterknife dependency fixes the issue. Though if you have a large project and want to migrate to kotterknife it would be very useful to be able to use both simultaneously.

I have embedded the kotlin file in my project for now.

@Evanuke
Copy link

Evanuke commented Aug 24, 2017

Is there any chance to avoid this problem? I got exact same error. I want to use 3rd party library, based on Java, which use Butterknife, but I already use in my project Kotterknife because it's fully written in Kotlin :(

@CodyEngel
Copy link

CodyEngel commented Aug 25, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants