0

我将兼容性.jar添加到我的项目(使用片段等的那个)但现在每次我构建我的应用程序 Eclipse 都会抛出以下错误。我通过将.jar复制到libs/文件夹中来添加它,然后在Project Properties对话框中使用Add Jar...。我这样做对吗?

[TimetableHC] Dx 
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompatHoneycomb;
[TimetableHC] Dx  at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[TimetableHC] Dx  at com.android.dx.dex.file.DexFile.add(DexFile.java:143)
[TimetableHC] Dx  at com.android.dx.command.dexer.Main.processClass(Main.java:372)
[TimetableHC] Dx  at com.android.dx.command.dexer.Main.processFileBytes(Main.java:346)
[TimetableHC] Dx  at com.android.dx.command.dexer.Main.access$400(Main.java:59)
[TimetableHC] Dx  at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:294)
[TimetableHC] Dx  at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
[TimetableHC] Dx  at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
[TimetableHC] Dx  at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
[TimetableHC] Dx  at com.android.dx.command.dexer.Main.processOne(Main.java:313)
[TimetableHC] Dx  at com.android.dx.command.dexer.Main.processAllFiles(Main.java:233)
[TimetableHC] Dx  at com.android.dx.command.dexer.Main.run(Main.java:185)
[TimetableHC] Dx  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[TimetableHC] Dx  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[TimetableHC] Dx  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[TimetableHC] Dx  at java.lang.reflect.Method.invoke(Unknown Source)
[TimetableHC] Dx  at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:179)
[TimetableHC] Dx  at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:585)
[TimetableHC] Dx  at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:490)
[TimetableHC] Dx  at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
[TimetableHC] Dx  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[TimetableHC] Dx  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
[TimetableHC] Dx  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
[TimetableHC] Dx  at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
[TimetableHC] Dx  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[TimetableHC] Dx  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
[TimetableHC] Dx  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
[TimetableHC] Dx  at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:362)
[TimetableHC] Dx  at org.eclipse.core.internal.resources.Project$1.run(Project.java:545)
[TimetableHC] Dx  at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
[TimetableHC] Dx  at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:524)
[TimetableHC] Dx  at org.eclipse.core.internal.resources.Project.build(Project.java:115)
[TimetableHC] Dx  at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:145)
[TimetableHC] Dx  at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
[TimetableHC] Dx  at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
[TimetableHC] Dx  at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
[TimetableHC] Dx  at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
[TimetableHC] Dx  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[TimetableHC] Dx 1 error; aborting
[TimetableHC] Conversion to Dalvik format failed with error 1
4

1 回答 1

2

您描述的过程是正确的。但是,Android 构建工具认为您已经添加了两次。您是否还将它添加为您的项目正在引用的 Android 库项目,或者其他什么?

于 2011-03-27T10:35:53.567 回答