2

Is it my code or is running Eclipse on Ubuntu linux (or any other distro variant) causing this error message to show very often? Either when trying to compile, build project, or an equivalent, the error comes from the IDE itself. I read many questions in here that asking about maybe the same case that I have, like if the error message shows up you need to restart Eclipse and the error won't appear again.

Now I have one project thats using @override code like OnCreate, OnPause, OnStop and others on my script MainActivity.java. There is nothing wrong with the code, but everytime I try to run it as an android application, Eclipse shows an error like this:

Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/annotation/AnimRes;

Why is that? Has anyone had the same problem and discovered the answer? Many thanks.

Regards, Indra.

Henry
  • 42,982
  • 7
  • 68
  • 84
Indra C.
  • 31
  • 2
  • 6

3 Answers3

1

This is due to multiple occurrences of the same jar file getting added to your project. Generally, it is very difficult to find out multiple occurrences.

It would be better to remove the classpath of all the reference Android projects which our project is referring, and add them from the scratch.

Follow this procedure:

  1. Build the Android libraries first and make sure the jars required for building the Android projects are not exported
  2. Add the Android libraries in the project.properties of the Android project
  3. Compile the required project
  4. When a compilation issue comes, add the required jar
  5. Don't forget to export the jar
apaderno
  • 28,547
  • 16
  • 75
  • 90
Arijeet Saha
  • 1,118
  • 11
  • 23
0

I think it is related to the fact that there may be 2 jar files containing the same content. Check your build path and library projects and if you see same thing referenced twice remove it from one place.

Dan Riza
  • 397
  • 3
  • 11
0

I think you have to clean your project and rebuild it. because The temp values might have been available. When you clean it, this app will work and you can take build now

Simon Chius
  • 476
  • 5
  • 18