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.

3
  • 2
    Look at this stackoverflow.com/questions/7870265/… may be it would be helpfull. Commented Jul 4, 2014 at 8:00
  • Can you post more of the stacktrace? Commented Jul 4, 2014 at 8:00
  • Uncheck your .jar library under Project Properties -> Build -> Libraries Commented Jul 4, 2014 at 8:45

3 Answers 3

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
Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.