如何在 Android Studio 中重命名项目 [英] How to rename a project in Android Studio

查看:38
本文介绍了如何在 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.

  1. 关闭屏幕上的所有内容.
  2. 使用文件资源管理器(文件、Finder、Windows 资源管理器甚至终端:$ cd your/path/to/file)定位您的项目.
  3. 使用文件资源管理器重命名您的项目(确保您没有进入项目,只需找到它即可).
  4. 打开 Android Studio.
  5. 导入重命名的项目.
  1. Close everything on your screen.
  2. Locate your project with your File explorer (Files, Finder, Windows Explorer or even the Terminal: $ cd your/path/to/file).
  3. Rename your project with the File explorer (make sure you do not get inside the project, just locate it).
  4. Open Android Studio.
  5. Import the renamed project.

此后,Android Studio 将自动构建所有必需的文件.

After this, Android Studio will automatically build all the required files.

这篇关于如何在 Android Studio 中重命名项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆