After updating SDK and ADT for the latest release, I tried to run my application and Eclipse log the following error:
[- RichReaderDemo] Dx
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lbr/com/digitalpages/renderer/NewReaderActivity;
[- RichReaderDemo] Dx at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[- RichReaderDemo] Dx at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main.processClass(Main.java:486)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main.access$400(Main.java:67)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
[- RichReaderDemo] Dx at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
[- RichReaderDemo] Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
[- RichReaderDemo] Dx at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main.processOne(Main.java:418)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main.run(Main.java:206)
[- RichReaderDemo] Dx at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[- RichReaderDemo] Dx at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[- RichReaderDemo] Dx at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[- RichReaderDemo] Dx at java.lang.reflect.Method.invoke(Method.java:616)
[- RichReaderDemo] Dx at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:179)
[- RichReaderDemo] Dx at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:729)
[- RichReaderDemo] Dx at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:602)
[- RichReaderDemo] Dx at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
[- RichReaderDemo] Dx at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[- RichReaderDemo] Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
[- RichReaderDemo] Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:282)
[- RichReaderDemo] Dx at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:363)
[- RichReaderDemo] Dx at org.eclipse.core.internal.resources.Project$1.run(Project.java:545)
[- RichReaderDemo] Dx at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
[- RichReaderDemo] Dx at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:524)
[- RichReaderDemo] Dx at org.eclipse.core.internal.resources.Project.build(Project.java:123)
[- RichReaderDemo] Dx at com.android.ide.eclipse.adt.internal.project.ProjectHelper.build(ProjectHelper.java:869)
[- RichReaderDemo] Dx at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:146)
[- RichReaderDemo] Dx at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
[- RichReaderDemo] Dx at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
[- RichReaderDemo] Dx at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
[- RichReaderDemo] Dx at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
[- RichReaderDemo] Dx at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[- RichReaderDemo] Dx
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lbr/com/digitalpages/commons/activity/LoadingActivity;
[- RichReaderDemo] Dx at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[- RichReaderDemo] Dx at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main.processClass(Main.java:486)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main.access$400(Main.java:67)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
[- RichReaderDemo] Dx at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
[- RichReaderDemo] Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
[- RichReaderDemo] Dx at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main.processOne(Main.java:418)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
[- RichReaderDemo] Dx at com.android.dx.command.dexer.Main.run(Main.java:206)
[- RichReaderDemo] Dx at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[- RichReaderDemo] Dx at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[- RichReaderDemo] Dx at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[- RichReaderDemo] Dx at java.lang.reflect.Method.invoke(Method.java:616)
[- RichReaderDemo] Dx at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:179)
[- RichReaderDemo] Dx at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:729)
[- RichReaderDemo] Dx at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:602)
[- RichReaderDemo] Dx at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
[- RichReaderDemo] Dx at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[- RichReaderDemo] Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
[- RichReaderDemo] Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:282)
[- RichReaderDemo] Dx at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:363)
[- RichReaderDemo] Dx at org.eclipse.core.internal.resources.Project$1.run(Project.java:545)
[- RichReaderDemo] Dx at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
[- RichReaderDemo] Dx at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:524)
[- RichReaderDemo] Dx at org.eclipse.core.internal.resources.Project.build(Project.java:123)
[- RichReaderDemo] Dx at com.android.ide.eclipse.adt.internal.project.ProjectHelper.build(ProjectHelper.java:869)
[- RichReaderDemo] Dx at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:146)
[- RichReaderDemo] Dx at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
[- RichReaderDemo] Dx at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
[- RichReaderDemo] Dx at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
[- RichReaderDemo] Dx at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
[- RichReaderDemo] Dx at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[- RichReaderDemo] Dx 2 errors; aborting
[- RichReaderDemo] Conversion to Dalvik format failed with error 1
I ran into this issue after updating to the October 2011 r15 version of ADT and SDK. My project uses 3 projects as libraries, so there is a lot of interdependence between the projects. This error comes up (I believe) when the build tool sees the same object get defined multiple times. My guess is Google changed up how the library references work, so my old project setup was no longer valid.
I tried messing with the project's library and build path settings, but I couldn't get the build to be stable. The solution I came up with was to:
After I set up the library dependencies in the new workspace, everything compiled just fine. I had a lot of settings I didn't want to lose, so I copied the regenerated .project and .classpath files back into my original workspace and it has been working alright for me so far.
I think you should do Clean Project and rebuild it, solved it for me.
The solution is:
1) Delete the project (do no delete project contents from disk).
2) Delete the .project
and .classpath
files in the project.
3) Create new project with the current src (Create project from existing source
)
If this happens during export, delete files present in the bin directory of your project. and restart export. in less than 30 seconds is resolved
Go to Project-> Properties->Java Build Path->Libraries and remove all except the "Android X.Y" (in my case Android 5.0.1), You can keep android dependencies(if it doesn't contains any conflicting jar files). Do the same for order and export (in Project-> Properties->Java Build Path-> Order and export). Click OK. Clean the project. It should solve the problem. It is caused due to jar conflicting issues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With