Ansal Ali
Ansal Ali

Reputation: 1603

Unable to execute dex: Multiple dex files define Lorg/apache/commons/codec/binary/Base64;

[2015-10-14 17:48:05 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/apache/commons/codec/binary/Base64;
[2015-10-14 17:48:05 - MyApplication] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/apache/commons/codec/binary/Base64;

I know this happens because my two jar files contains the same class Base64. But they are two entirely different jar files, one is org.apache.httpcomponents.httpclient_4.3.6.jar and other is indooratlas-android-sdk-1.4.2-132-beta.jar.

And I need to use both the libraries as it is and need avoid the above error. hope someone can help me.

I have already read this and almost all related links.

FACT

I don't think it as duplicate of above mentioned question, because I am in search to recover from this error in a possible new way.

Upvotes: 1

Views: 923

Answers (1)

Alex Lipov
Alex Lipov

Reputation: 13928

One possible solution for this is to use the HttpClient port for Android.

Differences with the stock version of Apache HttpClient
..
3. Base64 implementation from Commons Codec replaced with Android Base64.

HttpClient won't include commons-codec's Base64, and your app will not have multiple definitions of Base64 class.

Additionally, since you're including the commons-codec library in your application make sure to read my blogpost in order to prevent potential unexpected behaviour (more specifically, runtime crashes).

Upvotes: 1

Related Questions