如何在 Eclipse 中从我的 Android 项目中删除依赖项
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10316587/
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
How to remove a dependency from my Android project in Eclipse
提问by jimbob
When I highlight my project, go to properties, select java build path and then try to remove an Android Dependency from my list of Android dependencies the remove button is grey'd out. How can I remove that specific dependency?
当我突出显示我的项目时,转到属性,选择 java 构建路径,然后尝试从我的 Android 依赖项列表中删除一个 Android 依赖项,删除按钮是灰色的。如何删除该特定依赖项?
回答by Fran Marzoa
JFTR:
JFTR:
I have had similar problem after a messed merge of two projects branches on Eclipse. I could revert the merge as I did not commited yet, but Eclipse project files that I do not store in my repository was messed.
在 Eclipse 上混淆了两个项目分支后,我遇到了类似的问题。我可以恢复合并,因为我还没有提交,但是我没有存储在我的存储库中的 Eclipse 项目文件被弄乱了。
The solution for me was to:
我的解决方案是:
- Delete the error message from "Problems" view.
- Clean the project (Project / Clean...)
- 从“问题”视图中删除错误消息。
- 清理项目(项目/清理...)
Solved!
解决了!
回答by Rajesh
Delete the dependency from the libs folder.
从 libs 文件夹中删除依赖项。
回答by Kfir Erez
Well, the above solutions didn't work for me so I just enter the project.properties file and remove the dependency (which is written there as a reference).
These are the steps on Ubuntu:
好吧,上述解决方案对我不起作用,所以我只需输入 project.properties 文件并删除依赖项(在那里编写作为参考)。
这些是 Ubuntu 上的步骤:
- Using console on project root folder type
sudo vi project.properties
- Go to the line that you want to remove and delete it (you can type double d to remove a line -->
dd
) - Close and save the file (press ESC and then
wq
) - Clean the project and rebuild.
- 在项目根文件夹类型上使用控制台
sudo vi project.properties
- 转到要删除的行并删除它(您可以键入 double d 删除一行 -->
dd
) - 关闭并保存文件(按 ESC 然后按
wq
) - 清理项目并重建。
Note: Before you change project.properties manually you are strongly advised to backup your project since this operation is unsafe!!!
注意:手动修改 project.properties 之前,强烈建议您备份您的项目,因为此操作是不安全的!!!
Sorry for the elaboration for those who speak fluent Linux.
对不起,那些说流利的 Linux 的人的阐述。
回答by Daniel Tang Eik Hong
2 types of dependencies I can found so far under Android Dependencies:
到目前为止,我可以在 Android 依赖项下找到 2 种类型的依赖项:
- Build path to your workspace libs folder
- Build path to some other project which install by Android tools and create as another project under Eclipse, e.g. GridLayout for android(android-support-v7-gridlayout.jar)
- 构建工作区 libs 文件夹的路径
- 构建一些其他项目的路径,这些项目由 Android 工具安装并在 Eclipse 下创建为另一个项目,例如 GridLayout for android(android-support-v7-gridlayout.jar)
To remove the first one, it is easy. Just delete the jars under libs folder. To remove the second one, it is also easy. Just go to the project's Build Path, select Android, remove the reference item under Librarypanel
要删除第一个,很容易。只需删除 libs 文件夹下的 jars。要删除第二个,也很容易。直接到项目的Build Path,选择Android,去掉Library面板下的reference项