0

When I try to building the APK with mobileposse integration, I get the below error, not sure what is missing.

[2015-01-08 14:20:54 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/mobileposse/client/sdk/core/Manifest$permission;
[2015-01-08 14:20:54 - Optimize My Android] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/mobileposse/client/sdk/core/Manifest$permission;

I have loaded the mobileposse SDK as a library in my project and the reference to the code works perfect, hence I am not adding the big chunks of information of what I did.

Rakesh Sankar
  • 9,337
  • 4
  • 41
  • 66
  • You have to many methods in your build. So the dexer is unable to compile the app due to it can only refernce 65k methods. Try to use proguard or use a multidex build wih gradle. – A.S. Jan 08 '15 at 19:31

1 Answers1

0

Android application (APK) files contain executable bytecode files in the form of Dalvik Executable (DEX) files, which contain the compiled code used to run your app. The Dalvik Executable specification limits the total number of methods that can be referenced within a single DEX file to 65,536, including Android framework methods, library methods, and methods in your own code. https://developer.android.com/tools/support-library/features.html

There are a few options you could try:

Getting rid of ballast

Do you really need all these libraries in your project. Especially google play services are now devided in different sections (e.g. drive, messaging,....) don't use the legacy old one which includes all functions.

Proguard

Try to strip down the number of methods using proguard.

Multidex Support

Try to use the latest gradle plugin and the multidex support library. Google Developers

Further Information:

Link, Link

A.S.
  • 4,574
  • 3
  • 26
  • 43