eclipse 从不在我的项目的 libs 文件夹中的“Android 私有库”中删除项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21744928/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 21:31:15  来源:igfitidea点击:

Remove item from "Android Private Libraries" that is not in my project's libs folder

androideclipseadt

提问by Jules

The scenario is this: Eclipse Juno, ADT 22. The android project was created with a dependency on another Eclipse project (not an Android project, just a plain Java one) which exported a dependency on another library. I have since removed the Java project from the list of dependencies, but the exported library dependency remains in the Android Private Libraries section of my project's build path, and I can't figure out how to remove it.

场景是这样的:Eclipse Juno,ADT 22。创建的 android 项目依赖于另一个 Eclipse 项目(不是一个 Android 项目,只是一个普通的 Java 项目),它导出了对另一个库的依赖。从那以后,我从依赖项列表中删除了 Java 项目,但导出的库依赖项仍保留在项目构建路径的 Android 私有库部分中,我不知道如何删除它。

Any ideas?

有任何想法吗?

(For reference, here's what the build path looks like:

(作为参考,构建路径如下所示:

java build path dialog showing library

显示库的 java 构建路径对话框

The lib I want to get rid of is "simple-xml-2.6.2.jar", as I've switched to using JSON rather than XML and no longer need it. The project "bincomodel" is no longer a dependency of this project; I removed it on the Projects tab.)

我想摆脱的库是“simple-xml-2.6.2.jar”,因为我已经改用 JSON 而不是 XML 并且不再需要它。项目“bincomodel”不再是该项目的依赖项;我在“项目”选项卡上将其删除。)

采纳答案by Jules

Turns out there are two places that the reference to the previous project needed to be deleted from, not just one. It had to be taken out of both the "Projects" tab on "Build Path" and out of "Project References" in the project properties.

原来有两个地方需要删除对上一个项目的引用,而不仅仅是一个。它必须从“构建路径”上的“项目”选项卡和项目属性中的“项目引用”中取出。

I believe that ADT is automatically including any jars in the "libs" folder of any project included in the "Project References" list, whether or not they are an exported dependency. It also appears to link by default any jars that are in source folders, which eclipse standard doesn't do.

我相信 ADT 会自动包含“项目引用”列表中包含的任何项目的“libs”文件夹中的任何 jar,无论它们是否是导出的依赖项。默认情况下,它还似乎链接了源文件夹中的任何 jar,而 eclipse 标准则不这样做。

回答by Aiden Fry

In my case I had removed a few .jar libs from the file system however the project had not updated after doing SVN update.

就我而言,我已经从文件系统中删除了一些 .jar 库,但是在执行 SVN 更新后项目没有更新。

Once I clicked on the libs folder the .jar flashed like it was there and then disappeared. So if you have this issue then try Right Click project > Refresh, this will update all folders with the underlying file structure.

一旦我点击了 libs 文件夹,.jar 就像它在那里一样闪烁然后消失了。因此,如果您遇到此问题,请尝试右键单击项目 > 刷新,这将使用基础文件结构更新所有文件夹。

Eclipse then auto updated to remove the files from the private libs build path.

Eclipse 然后自动更新以从私有库构建路径中删除文件。

A

一种

回答by Nataly Nguyen

exit eclipse and go to folder your_project/libs/. Delete file .jar you want.

退出 eclipse 并转到文件夹 your_project/libs/。删除你想要的文件 .jar。

回答by Jacob

I suppose you could try to delete the unnecessary dependencyfrom appropriate .classpath, afaik this path is not recommended.

我想您可以尝试dependency从适当的文件中删除不必要的内容.classpath,但不建议使用此路径。

回答by gopeca

Edit the file project.properties in your filesystem and delete what you need. In my case I removed gridlayout_v7 deleting the second line:

编辑文件系统中的文件 project.properties 并删除您需要的内容。在我的情况下,我删除了 gridlayout_v7 删除了第二行:

# Project target.
target=android-15
android.library.reference.1=../appcompat_v7
android.library.reference.2=../gridlayout_v7