无法使用其他JAR运行Admob JAR

时间:2011-08-24 13:38:28

标签: android jar openfeint

我正在尝试将外部JAR添加到我的项目中,并收到此错误:

-

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lorg/codehaus/jackson/Base64Variant;
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.dx.dex.file.DexFile.add(DexFile.java:143)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.dx.command.dexer.Main.processClass(Main.java:372)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.dx.command.dexer.Main.processFileBytes(Main.java:346)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.dx.command.dexer.Main.access$400(Main.java:59)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:294)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.dx.command.dexer.Main.processOne(Main.java:313)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.dx.command.dexer.Main.processAllFiles(Main.java:233)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.dx.command.dexer.Main.run(Main.java:185)
[2011-08-24 16:35:19 - MyProjApp] Dx at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
[2011-08-24 16:35:19 - MyProjApp] Dx at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[2011-08-24 16:35:19 - MyProjApp] Dx at java.lang.reflect.Method.invoke(Unknown Source)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:179)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:652)
[2011-08-24 16:35:19 - MyProjApp] Dx at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:510)
[2011-08-24 16:35:19 - MyProjApp] Dx at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
[2011-08-24 16:35:19 - MyProjApp] Dx at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2011-08-24 16:35:19 - MyProjApp] Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
[2011-08-24 16:35:19 - MyProjApp] Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
[2011-08-24 16:35:19 - MyProjApp] Dx at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
[2011-08-24 16:35:19 - MyProjApp] Dx at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2011-08-24 16:35:19 - MyProjApp] Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
[2011-08-24 16:35:19 - MyProjApp] Dx at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
[2011-08-24 16:35:19 - MyProjApp] Dx at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
[2011-08-24 16:35:19 - MyProjApp] Dx at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
[2011-08-24 16:35:19 - MyProjApp] Dx at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
[2011-08-24 16:35:19 - MyProjApp] Dx at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[2011-08-24 16:35:19 - MyProjApp] Dx 1 error; aborting
[2011-08-24 16:35:19 - MyProjApp] **Conversion to Dalvik format failed with error 1**

-

我知道jar和我添加的图书馆项目(Open-Feint库)存在冲突。

我的问题是,我能做些什么来解决这个问题吗?

2 个答案:

答案 0 :(得分:3)

我在OpenFeint库中遇到了同样的问题,我想出来了。

如果您还在

中包含GameFeed项目

项目>属性> Android>文库

部分,您可能会将OpenFeint API源包括两次,一次在OpenFeint库中,一次在GameFeed项目中作为依赖库。

我必须从GameFeed项目中删除OpenFeint API源链接,然后一切正常。

底线是某种程度上你有两次在你的项目中内置了一些源代码。

答案 1 :(得分:0)

一个不太好的解决方案是检查双类文件是否是完全相同的版本,如果是,请从其中一个罐子中删除它们... 这是一个解决方案,但不是一个非常安全的解决方案......只有在你必须的时候才这样做。