• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps facing this error - Conversion to Dalvik format failed with error 1

omarozi

Lurker
while building a project in Eclipse using amdroid I face the following error. plz help me

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/android/commands/am/Am$1;
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.dx.dex.file.DexFile.add(DexFile.java:143)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.dx.command.dexer.Main.processClass(Main.java:338)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.dx.command.dexer.Main.processFileBytes(Main.java:315)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.dx.command.dexer.Main.access$100(Main.java:56)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:266)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.dx.command.dexer.Main.processOne(Main.java:284)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.dx.command.dexer.Main.processAllFiles(Main.java:220)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.dx.command.dexer.Main.run(Main.java:176)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at java.lang.reflect.Method.invoke(Unknown Source)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(Unknown Source)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(Unknown Source)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(Unknown Source)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:218)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:360)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.resources.Project$1.run(Project.java:523)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1782)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:502)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.resources.Project.build(Project.java:94)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.ui.actions.BuildAction.invokeOperation(BuildAction.java:221)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.ui.actions.WorkspaceAction.execute(WorkspaceAction.java:162)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.ui.actions.WorkspaceAction$2.runInWorkspace(WorkspaceAction.java:483)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
[2010-12-27 17:44:15 - fallwallpaper]: Dx at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
[2010-12-27 17:44:15 - fallwallpaper]: Dx1 error; aborting
[2010-12-27 17:44:15 - fallwallpaper] Conversion to Dalvik format failed with error 1
 

I posted this to the developers forum....same logs and all. Lots of people have read it, no one has responded.
I found a post saying (I think) that the Android SDK had a bug, and that the fix was out. I upgraded to
Android SDK revision 11 (from revision 10), An error about 'R" not resolving returned (and went away when
I re-saved the java file), but attempts to build the project STILL failed with the same errors.

The full log of errors I'm seeing (which start and end just like the above) is in my post in the developers forum
called "Lost in Ch 6 of Learning Android" (I wish I knew how to re-name a thread I started...that's not such a
great title now...I posted a follow-up instead of a new thread, and got stuck with the old subject).
 
Sorry to hear that you haven't received responses!

Unfortunately that tends to be where the developers on this forum hang out so it's likely the best place on this forum for you to find an answer. In this forum we'll see mostly new forum members, most of whom are simply end users and not developers.
 
Sorry to hear that you haven't received responses!

Unfortunately that tends to be where the developers on this forum hang out so it's likely the best place on this forum for you to find an answer. In this forum we'll see mostly new forum members, most of whom are simply end users and not developers.

And I'm still somewhere in-between.... :-) I'm an end-user, trying to learn how to develop apps. I have some
ideas, but haven't gotten that far yet, since I A) can't get the AVD to load (have to use my phone), and B) am
now stuck not being able to build the example app from the O'Reilly book, Learning Android that I spent half
of my available spending money for the month on.

Oh, and I forgot to mention something about the error about 'R' not resolving (book says the 'R' class is
generated automatically). Eclipse only quit complaining when I imported it from the current project.
Strange....very strange.
 
For what it's worth, I just realized that I had NOT posted my question to the developers group. I posted it to
application development/application development (which I thought was the development/developers group.

I just joined the developers e-mail list, and am about to post it there. If I get an answer, I'll post it here for
the folks who are looking for it here.

EDIT: it's now over 6.5 hours since I posted to the list, and it hasn't even shown up there yet. The list's
incoming queue must be massively backed up.....

So, with that in mind, is there any way to FORCE Eclipse to ignore the error in converting to Dalvik format
and build the project anyways? Or is that a stupid question I should not have asked? <grin>
 
Thanks to B Lyon in the developers forum, this problem, at least for my "Learning Android"
example app, is SOLVED. We exchanged quite a few e-mails late last night and early this
morning, and it all led to the answer, just a few minutes ago.

jtwitter.jar and android.jar both had a class called org/jsonm, and THAT was causing a redundant
class error that eventually hosed everything. I tried deleting the redundant class, but of course,
that failed. Then, just a little while ago, something I noticed last night, after being asked about
my .classpath file, lit up a bright light inside my head. :-)

In my .classpath file, jtwitter.jar was listed first, and then android.jar. I exited out of Eclipse,
opened the .classpath up with vim, reversed the two lines, re-started Eclipse, and it built just
fine. Zero errors. :-)

So a billion thank-yous to B Lyon over in the developers group for giving me a tremendous
amount of help that eventually led to the answer. :-)
 
Hey.....this was supposed to be a NEW THREAD, not another (redundant) follow-up.... removing
and reposting as a new thread.....oops!
 
Back
Top Bottom