在Eclipse中使用的Andr​​oid库和跳跃类文件,而不是源文件,该文件是在Eclipse工作区是在、源文件、该文件、而不是

2023-09-05 05:44:48 作者:24K·纯爷们づ

我发现这个bug http://$c$c.google.com/p/android/issues/detail?id=20731被解决,但它并没有解决这个问题完全是,但我在评论中看到,这个被提到的有作为的问题。是否有某种方式在Eclipse中的项目设置的依赖不知何故,我将能够正常跳转到源当我在Eclipse编辑器?我试过无数的方法来解决这个问题。

I found this bug http://code.google.com/p/android/issues/detail?id=20731 that is resolved but it did not fix this exactly, but I see in comments that this is mentioned there as problem. Is there some way in eclipse to setup dependencies in project somehow , that I will be able to normally jump to source when I am in eclipse editor ? I tried numerous ways to solve this.

我的设置是:

Android项目已在安卓>库

Android project that has Android Library setup in Android>Library

Android的库项目,是在工作区,并有依赖于Java库项目

Android Library project that is within workspace and have dependency on Java library project

Java库项目,该项目是在工作区,并打开的类文件,而不是源!

Java Library project that is within workspace and is opened as class file instead of source !!!

包括通过正常的构建路径的Java库项目(这是导致生成失败) [2012-03-13 11时07分21秒 - Taxicar驱动程序的Andr​​oid]霉素 意外的顶级例外: java.lang.IllegalArgumentException:如果已经添加:Lrensoft /爪哇/收藏/ GenericIterator; [2012-03-13 11时07分21秒 - Taxicar驱动程序的Andr​​oid]霉素在com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123) [2012-03-13 11时07分21秒 - Taxicar驱动程序的Andr​​oid]霉素在com.android.dx.dex.file.DexFile.add(DexFile.java:163)

Including java library project through build path normally (this is causing build to fail) [2012-03-13 11:07:21 - Taxicar Driver Android] Dx UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: already added: Lrensoft/java/collections/GenericIterator; [2012-03-13 11:07:21 - Taxicar Driver Android] Dx at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123) [2012-03-13 11:07:21 - Taxicar Driver Android] Dx at com.android.dx.dex.file.DexFile.add(DexFile.java:163)

不包括的项目运行正常,但编辑器跳转到库的类文件。

Not including , project runs ok , but editor is jumping to library class files.

请注意,我必须包括通过构建路径的Andr​​oid库项目,即使它运行正常,没有它(它是足够设置是为相关的Andr​​oid库),但是当我删除它,我得到同样的文件类文件: )。

Note that I have to include Android Library project through build path , even though it runs ok without it (it is enough to set is as dependent android library) , but when I remove it I get also those files as class files :) .

所以我认为,正确的做法是不包括通过构建路径的项目,但在所有又如何安装项目跳到源?

So I think that right way is not including projects through build path at all but how then setup project to jump to source ?

推荐答案

我找到了解决办法。我必须从我的Java库中创建的Andr​​oid库和然后包括它的Andr​​oid库和Java库,然后我不得不重新排序构建路径的出口产品因此Android库项目是最后一次。而且也没有太多的工作,现在,即使重命名重构的作品,有一定的警示作用,但工程:),那么我又是幸福的开发者。

I found solution. I have to create Android library from my java library as well and then include it as android library as well as Java library , Then I have to reorder build path export items so Android "Library Projects" are last . And well not much work, Now even rename refactoring works , with some warning but works :) , Well I am happy developer again.