如何在Android Studio中重命名项目 [英] How to rename a project in Android Studio
问题描述
我当前正在使用最新版本的Android Studio 1.4.1.我想在我的朋友中分发我的程序,但这是学校的期末考试,因此命名为FinalProject.我想重命名它,但是无论我尝试做什么(即使使用此站点的答案),我似乎也都做不到.
I am currently using Android Studio 1.4.1, the latest version. I would like to distribute my program among my friends, but it was a school final, so it's named FinalProject. I'd like to rename it, however whatever I try to do (even using answers from this site), I can't seem to do it.
我尝试右键单击面包屑上的根文件,但显示无法重命名根模块".我真的不知道还能做什么.
I've tried right-clicking the root file on the bread crumbs, but it says "Can't rename root module." I don't really know what else I can do.
我尝试重命名想法,build.gradle和AndroidManifest.xml中的部分,但这没有用.如果我还在清单中重命名,它将破坏整个清单.
I've tried renaming the parts in the idea, build.gradle, and AndroidManifest.xml, but that didn't work. If I also rename it in the manifest, it breaks the entire manifest.
推荐答案
这始终对我有用,它将更改项目的名称,但请注意,它不会重命名其内部软件包.
This always works for me, it will change the project's name, but be careful, it will not rename its internal packages.
- 关闭屏幕上的所有内容.
- 使用文件资源管理器(文件,Finder,Windows资源管理器或终端机:
$ cd your/path/to/file
)找到您的项目. - 使用文件资源管理器重命名项目(确保您没有进入项目内部,只需找到它即可).
- 打开Android Studio.
- 导入重命名的项目.
- Close everything on your screen.
- Locate your project with your File explorer (Files, Finder, Windows Explorer or even the Terminal:
$ cd your/path/to/file
). - Rename your project with the File explorer (make sure you do not get inside the project, just locate it).
- Open Android Studio.
- Import the renamed project.
此后,Android Studio将自动构建所有必需的文件.
After this, Android Studio will automatically build all the required files.
这篇关于如何在Android Studio中重命名项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!