Java 如何在 Android Studio 中重命名项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35050557/
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
How to rename a project in Android Studio
提问by Wildfire Blake
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.
我目前使用的是最新版本的 Android Studio 1.4.1。我想将我的程序分发给我的朋友,但它是学校期末考试,所以它被命名为 FinalProject。我想重命名它,但是无论我尝试做什么(即使使用本网站的答案),我似乎都无法做到。
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.
我尝试右键单击面包屑上的根文件,但它显示“无法重命名根模块”。我真的不知道我还能做什么。
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.
我已经尝试重命名想法中的部分 build.gradle 和 AndroidManifest.xml,但这没有用。如果我也在清单中重命名它,它会破坏整个清单。
采纳答案by Evin1_
This always works for me, it will change the project's name, but be careful, it will not rename its internal packages.
这总是对我有用,它会更改项目的名称,但要小心,它不会重命名其内部包。
- Close everythingon 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.
- Importthe renamed project.
- 关闭屏幕上的所有内容。
- 使用文件资源管理器(文件、Finder、Windows 资源管理器甚至终端:)找到您的项目
$ cd your/path/to/file
。 - 使用文件资源管理器重命名您的项目(确保您没有进入项目,只需找到它)。
- 打开安卓工作室。
- 导入重命名的项目。
After this, Android Studio will automatically build all the required files.
在此之后,Android Studio 将自动构建所有需要的文件。