eclipse 从项目 Android Studio 中删除引用的库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20844408/
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
Removing referenced libraries from project Android Studio
提问by Boardy
I am trying to get Android Studio to work with library dependencies for my project, I am using Android Studio 0.4.0.
我正在尝试让 Android Studio 为我的项目使用库依赖项,我使用的是 Android Studio 0.4.0。
I've removed the dependecies from the project structure dialogue, from the settings.gradle and from the build.gradle and also from my project.iml file.
我已经从项目结构对话框、settings.gradle 和 build.gradle 以及我的 project.iml 文件中删除了依赖项。
I then delete the directories of the referenced libraries from my main project, but after a few seconds, the referenced library directory reappears but only contains mylibrary.iml file. Everytime I delete it, it reappears again.
然后我从我的主项目中删除引用库的目录,但几秒钟后,引用库目录重新出现但只包含 mylibrary.iml 文件。每次我删除它,它都会再次出现。
Also when Android Studio loads it displays an error stating that non gradle projects can't be referenced from gradle projects but I no longer want them referenced but somehow I can't get rid of them.
此外,当 Android Studio 加载时,它会显示一个错误,指出无法从 gradle 项目中引用非 gradle 项目,但我不再希望引用它们,但不知何故我无法摆脱它们。
The project was imported into Android Studio from an Export from Eclipse.
该项目是从 Eclipse 的导出导入到 Android Studio 中的。
Thanks for any help you can provide.
感谢您的任何帮助,您可以提供。
回答by Scott Barta
Generally, clicking on the Sync Project with Gradle Filesbutton should clear up problems, but if they persist, you can close Android Studio, delete all the .idea
folders and .iml
files in your project and re-import.
通常,单击Sync Project with Gradle Files按钮应该可以解决问题,但如果问题仍然存在,您可以关闭 Android Studio,删除项目中的所有.idea
文件夹和.iml
文件,然后重新导入。
回答by brunobowden
There is an official bug on improving this for Android Studio. It includes a bigger description of the problem and a workaround suggested by one of the Android Studio engineers:
有一个关于为 Android Studio 改进此功能的官方错误。它包括对问题的更详细的描述以及一位 Android Studio 工程师建议的解决方法:
Bug description - click on the star button to follow it: https://code.google.com/p/android/issues/detail?id=61510
错误描述 - 点击星号按钮关注它:https: //code.google.com/p/android/issues/detail?id=61510
Google Engineer suggested workaround (note that some of the bugs described are fixed): https://code.google.com/p/android/issues/detail?id=61510#c3
谷歌工程师建议的解决方法(请注意,描述的一些错误已修复):https: //code.google.com/p/android/issues/detail?id=61510#c3