Abdul Wasae Abdul Wasae - 1 month ago 24
Java Question

Unable to execute dex: Multiple dex files define Lbolts/AggregateException

I do know Multiple dex problems have been reported a lot of times before, but i none of the solutions seem to work in my case.

Console:

Unable to execute dex: Multiple dex files define Lbolts/AggregateException;
Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lbolts/AggregateException;


One of the popular solutions is unmarking the 'Android private libraries' container from buildpath. I cannot do that because there are a few more libraries in that container that i need.

Another solution is unmarking any duplicate library explicitly added in .jar form. I have no such libraries.

The duplicate library in my case is: android-support-v7-appcompat.jar
I have it (directly referenced from the sdk folder) in these two containers:

1.) Android Private Libraries

2.) Android Dependencies

The problem is that just cannot untick any of these two containers completely, because both of them contain other necessary libraries. But i also am unable to remove just this duplicate .jar file from either containers.

EDIT:
N.B. when i add the v7compat support library_project to my project, it enters into both containers. There must be some way so that goes into only one.

Can any one help me how can i do it?

screenshot

screenshot2 (unable to delete)

Answer

SOLVED SOMEHOW

what was actually causing the trouble is the bolts-android library. there were two DIFFERENT versions of it conflicting. the facebooksdk comes with bolts-android-1.1.2 and appcompatv7 comes with 1.1.4.

I unmarked Android Private Libraries container in the FacebookSDK library project, which contained bolts-android-1.1.2. As a result, my project now had only one version, 1.1.4

it runs fine now

turns out, the duplicate appcompatv7 entries were never troubling