0

I was wondering is there a way of avoid multiple dex error ? I am using a library, I need some of its old classes from an older version and some of its new from a newer version. So when I add both jars then I get a multiple dex error. I know the cause of error, that is the both jars has same package name and same classes name.

Is there a way of avoiding this error? Is not could you please suggest an alternative. That'll be really helpful. But I've to use both jars.

1 Answers1

0

Right click your project->properties->Java build path ->order and export.Then Uncheck android.support jar.

Then clean your project and run

Stephen
  • 9,899
  • 16
  • 90
  • 137
  • No I am not talking about android support libraries. I am any library, Lets say I am using Lucene 3.6 and there are some classes in Lucene 3.7 that I want to use. But because of package and class name conflict I got duplicate dex error. How To handle this problem? – Bilal Islam Jan 25 '15 at 11:12
  • @BilalIslam delete one of them and run the project – Stephen Jan 25 '15 at 11:14
  • Thats the problem. I need both :) – Bilal Islam Jan 25 '15 at 11:16
  • @BilalIslam then try like check one of them and uncheck another one. – Stephen Jan 25 '15 at 11:25
  • @BilalIslam Refer [this](http://stackoverflow.com/questions/2247998/noclassdeffounderror-eclipse-and-android) and [this](http://stackoverflow.com/questions/8678630/noclassdeffounderror-for-code-in-an-java-library-on-android) – Stephen Jan 25 '15 at 11:46