1

我的Eclipse 环境中有一个 Java 项目“ EDNA ”,它使用名为libosmosmnavigation的库。

在此处输入图像描述

我将包含libosmosmnavigation的“ EDNA ”导出到 jar 中。EDNA.jar 被导入我的 Android 2.2 项目“ Tableted ”(复制到 libs 文件夹)。libosmosmnavigation会自动添加:

在此处输入图像描述

Tableted在“Java Build Path -> Projects”中没有设置任何内容。“Java 构建路径 -> 库”如下所示:

在此处输入图像描述

当我点击调试时,会发生以下错误:

[2012-11-13 09:53:20 - Tableted] Dx bad class file magic (cafebabe) or version (0033.0000)
...while parsing de/hk/econnect/math/CHull.class
...while processing de/hk/econnect/math/CHull.class
[2012-11-13 09:53:20 - Tableted] Dx 
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added:     Lcom/bretth/osmosis/core/xml/v0_5/XmlDownloader;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
at com.android.dx.command.dexer.Main.processClass(Main.java:486)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
at com.android.dx.command.dexer.Main.access$400(Main.java:67)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
at com.android.dx.command.dexer.Main.processOne(Main.java:418)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
at com.android.dx.command.dexer.Main.run(Main.java:206)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:180)
at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:703)
at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:577)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
at org.eclipse.core.internal.resources.Project.build(Project.java:124)
at com.android.ide.eclipse.adt.internal.project.ProjectHelper.doFullIncrementalDebugBuild(ProjectHelper.java:1000)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:147)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:937)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1141)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[2012-11-13 09:53:20 - Tableted] Dx 10 warnings
[2012-11-13 09:53:20 - Tableted] Dx 1 error; aborting
[2012-11-13 09:53:20 - Tableted] Conversion to Dalvik format failed with error 1

除了添加 jar 之外,我还尝试引用该项目。但这会导致同样的错误。

4

1 回答 1

0

它们是否在“订购和导出”选项卡下添加和标记?
否则试试这个,这是一个普遍的问题,在我看来是红色的,它不能让它们正确导出。

于 2012-11-13T09:56:48.100 回答