android studio怎么删,如何在Android Studio中删除模块

The "Mark as Excluded" option isn't there anymore.

The current (Android Studio 0.8.x - 2.2.x) way to do this is via the Project Structure dialog. It can be accessed via "File -> Project Structure" or by right-clicking on a Module and selecting "Module Settings".

fb423a15c5244642845c347951bb0f37.png

Then select the module, and click the "minus" button to remove it.

c4abb4667dc76cfb677247332547a1d1.png

The directory will still be visible in the "Project" view (though not in the "Android" view) since it's not actually deleted, but it will no longer be treated as a module.

If you want, you can then physically delete the files it by right-clicking on it and pressing "Delete".

(Editor's Note: This answer was correct in May 2013 for Android Studio v0.1, but is no longer accurate as of July 2014, since the mentioned menu option does not exist anymore -- see this answer for up-to-date alternative).

First you will have to mark it as excluded.

Then on right click you will be able to delete the project.

e2b09bbcfbf003ab66bc065ea9b2216e.png

d8844a2d3f2faab0e086ee818de291e0.png

In Android Studio 1.0 - 1.1b4, I found this to be the easiest way to remove a module:

Open settings.gradle found under Gradle Scripts

Delete module's name from the include statement

Sync Project with Gradle Files

Optionally, delete it manually from the project folder

Example

Old:

include ':app', ':greendao'

New:

include ':app'

As I saw that in Android Studio 0.5.1, you have to close your project by doing simply File -> Close Project then move your mouse over the project which you want to delete then keep your mouse on the same project and press delete then click on "OK" button that would delete your project from Android Studio.

20811e2639ab15e0c7f98bf6eca1e5bb.png

cc1f1c090e10ac74526d8f56bb649a6f.png

In Android studio v1.0.2

Method 1

Go to project structure, File -> Project Structure..., as the following picture show, click - icon to remove the module.

0cc5c3ddc1a1e6e28f4cdb66b9a8f654.png

Method 2

Edit the file settings.gradle and remove the entry you are going to delete. e.g. edit the file from include ':app', ':apple' to include ':app'.

That will work in most of the situation, however finally you have to delete the module from disk manually if you don't need it anymore.

Here is for Android studio 2.3.3

I did not find any Project Structure under File menu.

So here are steps in pictures

49e34ab337d9a53ed2d151b422791ce5.png

beb07cd62401b779c5753dcf9c997b10.png

68c9cb35a3b4762c99fcf71dea666135.png

65c33a19f935ad1deafd99274f76e33d.png

I'm currently running the 0.5.8 version of Android Studio and I can't even find the "Mark folder as" option when I right click, what I do is:

Right click on project -> Click on Show in Explorer and then just delete it from there.

You can achieve the same result by deleting it directly through Windows Explorer. That's the only way I've been able to get rid of Projects I did not want anymore. Oh and of course, this also removes it from the hard disk.

Deleting is such a headache. I am posting the solution for Android Studio 1.0.2.

Step 1: Right click on the "Project Name" selected from the folder hierarchy like shown.

Note: It can also be deleted from the Commander View from right hand side of your window by right clicking the project name and selecting delete from the context menu.

f4d27b3ba6b791647d7892aa5ce61edd.png

Step 2: The project is deleted(seemingly) but gradle seems to keep the record of the project app folder(Check it by clcking on the Gradle View). Now go to File->Close Project.

Step 3: Now you are at the start window. Move the cursor on the in recent project list. Press Delete.

Step 4: Delete the folder from the explorer by moving or deleting it actually. This location is in your_user_name->Android Studio Projects->...

Step 5: Go back to the Android studio window and the project is gone for good. You can start a new project now.

edit the project's settings.gradle file: delete the module name (, ':xxxxx') where xxxxx is the module name to be deleted

using the file explorer delete the module folder

by the way, the current version of the Android Studio (v3.1.2) throws an exception and exits the removing with an error while I'm removing the module through Module Settings => selected module => - (minus)

Best Regards, thanks)

Assuming the following:

You are working with Android Studio 1.2.1 or 1.2.2 (I don't have the latest yet, will edit this again when I do).

Your Project Tool Window is displaying one of the following views: "Project", "Packages", "Android" or "Project Files"

You can delete an Android Studio module as follows:

In the Project Tool Window click the module you want to delete.

Between the Tool Bar and the Project Tool Window the tool bar you will see two "chips" that represent the path to the selected module, similar to: your-project-name > selected-module-name

Right click on the selected-module-name chip. A context menu with multiple sections will appear. In the third section from the bottom there will be a section that contains "Reformat Code..", "Optimize Imports..." and "Delete".

Select "Delete" and follow any prompts.

The most reliable way I have found to do this it to go to project structure and remove it from dependencies and remove it from your setting.gradle file.

It will appear as if it is fully deleted at his point but it is not. If you try to re add the module it will say that it already exist in the project.

The final step is to go to the location of your project using file explorer etc and delete the module.

This work 100% of the time on studio 1.3.1

In android-studio version 2. just go

Right Click on Project-->Open Module Option-->Click Your Module --> click sign done then press ok button.

After doing what's referred in [this answer]: https://stackoverflow.com/a/24592192/82788

Select the module(since it's still visible on the Project view),pressing Delete button on the keyboard can delete this module on disk.(Before doing what's referred in that answer, the Delete button has no effect.)

Remove from File > File Structure > Dependencies > - button. Then if it is stull there you can remove the module by going to the settings.gradle file and removing it from the include line.

To delete a module in Android Studio 2.3.3,

Open File -> Project Structure

On Project Structure window, list of modules of the current project gets displayed on left panel. Select the module which needs to be deleted.

Then click - button on top left, that means just above left panel.

Steps to follow Remove Modules in Android Studio:3.1.4.

Goto Project-->Right Click on Module (FolderIcon-GreywithGreenColorDot)

-->Load/UnLoadModules in PopUp

-->Select Which Module to Unload in PopUpWindow169f7dc85838a574aa855e79d81f6bab.png

Again RightClick on Module (FolderIcon-OrangeColor) -->Remove module.

Finally, RightClick again on Module (FolderIcon-GreyColor) -->Delete.

Note:Incase Project Enabled with Git please remove module from settings.gradle, otherwise deleted module.iml will show in project module list(Reference Link).gradle.xml which is located in project/.idea/gradle.xml--remove a module from here.

Hope it helps.

Thank-you.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值