问题描述
我已经安装了 android studio 1.0.1 版.我已经从 eclipse 导入了我的项目,它工作正常.然后我删除了一个模块并将其重新导入到我的 android studio 项目中.gradle build 说build successful",但它会弹出一个带有消息的警报窗口
i have installed android studio version 1.0.1. i have imported my projects from eclipse and it works fine. then i deleted a module and reimported it into my android studio project. the gradle build says "build successful" but it pops up an alert window with the message
未能完成 gradle 执行.原因:已处置:模块:'mymodulename'
我现在无法启动我的应用程序.知道我能做什么吗?
i can't start my app now. any idea what i can do?
我通过以下说明解决了这个问题:
i solved the problem with the following instructions:
- 将项目视图从 android 切换到 project
- 删除 settings.gradle 中包含mymodulename"的条目
- 模块符号中的蓝色框不显示.然后您可以在上下文菜单中删除该模块
- 导入模块
推荐答案
注意:这纯粹是 idea/as 问题,gradlew clean |构建 > 清洁 |build > rebuild 只会浪费你的时间.
note: this is purely an idea/as issue, gradlew clean | build > clean | build > rebuild will just waste your time.
这里的大多数百家乐凯发k8的解决方案都是在黑暗中盲目刺伤.以下是我发现的根本原因:
most of the solutions here are blind stabbings in the dark. here's what i found to be the root cause:
- 某些 .iml 文件可能丢失(可能是因为我们删除了它),检查模块错误是否有 .iml.
- 如果缺少,检查 .idea/modules.xml 是否有该模块的条目
- some of the .iml files may be missing (maybe because we deleted it), check if the module erroring has .iml.
- if it is missing, check if .idea/modules.xml has an entry for that module
同步时,我注意到 idea/as 尝试将一个新的重复条目放入 .idea/modules.xml 中,而已经有一个.在同步尝试重置内存中的模块时,此重复条目可能会被处理两次.
while syncing i noticed that idea/as tries to put a new duplicate entry into .idea/modules.xml while there's already one. this duplicate entry is probably disposed of twice while the sync tries to reset the modules in memory.
快速百家乐凯发k8的解决方案:为了使其正常工作,最简单的方法是删除 .idea/modules.xml 以及 .iml 文件.另外可能值得删除 .idea/modules/ 文件夹(如果存在).重新启动 android studio(无需清除缓存)并强制从 gradle 视图或工具栏同步 gradle 以重新创建文件.
quick solution: in order to make it work the easiest is to delete .idea/modules.xml along with the .iml files. additionally may worth deleting .idea/modules/ folder if it exists. restart android studio (no need to clear cache) and force a gradle sync from gradle view or toolbar to recreate the files.