I'm new to Android, trying to launch the project, which is being built and deployed well. But every time I make a try to start the app from eclipse, I get this error:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/.../model/AvailabilityRequest$DAY_TIME_PREFERENCE;
[2012-02-06 17:32:11 - main-app] Dx at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[2012-02-06 17:32:11 - main-app] Dx at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
[2012-02-06 17:32:11 - main-app] Dx at com.android.dx.command.dexer.Main.processClass(Main.java:486)
...
[2012-02-06 17:32:11 - main-app] Dx at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[2012-02-06 17:32:11 - main-app] Dx 1 error; aborting
[2012-02-06 17:32:11 - main-app] Conversion to Dalvik format failed with error 1
I've killed enormous amount of time for this stupid thing. Obviously, this is known problem, but nothing works for me.
What I have:
Operation system - OS X, which is important I think;
IDE - eclipse 3.7.1
ADT - Version: 15.0.1.v201111031820-219398
Build tool - Maven
What I've tried so far:
- Properties->Java Build Path->Libraries to remove all the libraries except Android x.y.z, then Maven->Update Project Configuration, also to clean the project;
- Magic with closing and reopening eclipse;
- Dances with deleting and recreating the project and the libraries for it (according to the text of error message, there is some duplication of the sources, which are in one of the 2 libraries, used in the main project).
After one of the variants above (usually the 1st one) it starts to work, but I can spend 20 mins to make it work or several hours..., today I can't manage to do it at all.
Any idea would be appreciated.