Android Studio - 删除模块 - IncorrectOperationException:不得更改文档外部命令或撤消透明操作

daz*_*ito 12 ide android android-studio

我正在尝试删除/删除我项目中的模块.

我转到"模块设置",然后选择我的模块并按" - "(减号)按钮.它问我是否真的要删除它,我按"是".然后这个例外被处理:

12:53:05 ExtensionException: org.intellij.lang.batch.runner.BatchRunConfigurationProducer: org.intellij.lang.batch.runner.BatchRunConfigurationProducer
12:53:10 IncorrectOperationException: Must not change document outside command or undo-transparent action. See com.intellij.openapi.command.WriteCommandAction or com.intellij.openapi.command.CommandProcessor: Must not change document outside command or undo-transparent action. See com.intellij.openapi.command.WriteCommandAction or com.intellij.openapi.command.CommandProcessor
Run Code Online (Sandbox Code Playgroud)

如果我回到模块设置,我的模块不再存在,但它仍然在项目树中.我重新启动android studio并返回模块设置,我的模块再次回到那里.

有人有这个问题吗?我怎样才能解决这个问题?

使用android studio 0.5.1

Sco*_*rta 23

这是一个错误; 我没有对它进行测试,看它是否会在0.5.2中得到修复,但目前在这个地方都存在异常的例外情况.

要解决此问题,请在settings.gradle文件中删除对模块的引用,然后单击" 使用Gradle文件同步项目"按钮.您的模块文件仍然在磁盘上,您可以从IDE的"项目"视图中看到它们,但它们将不再链接到代码中,您可以根据需要删除这些文件.

UPDATE

这是错误https://code.google.com/p/android/issues/detail?id=67220,将在0.5.2或0.5.3版本中修复.


Roh*_*hit 14

右键单击项目>打开模块设置

在此输入图像描述

选择要删除的模块(在我的情况下是其app2)

然后单击顶部的" - "(删除)按钮.

在此输入图像描述

就是这样,您的模块现在已从项目中删除.要删除该文件夹,只需将其删除即可.