关于在Android Studio中重命名Android项目(基于Gradle)的建议 [英] Advise on renaming a Android project in Android studio(Gradle based)
问题描述
在我目前的项目中,我希望在Android Studio(0.8.9)中重命名Android项目,并希望在以后使用它.我知道论坛上讨论的2个解决方案.可以请一些人确认最好的方法并且没有麻烦.此外,在Android Studio 0.8.9上尝试/测试的任何建议都是最好的.
In my present project , I wish to rename the Android project in Android studio (0.8.9) and wish to use it hereafter. I know about 2 solutions discussed in forum. Could some one please confirm best approach and hassle free. Moreover any advice tried/tested on Android studio 0.8.9 is best.
我知道的解决方案(但不确定)
A.-关闭正在考虑的项目.将其复制并重命名为新名称,然后使用Android Studio打开.
在这种情况下-项目.iml文件仍然显示旧名称,.idea"文件夹下的.name文件也显示旧名称.
我也收到此错误:
Solutions I know about (but not sure)
A.- Close the project under consideration.Copy it and rename to new name and open with Android studio.
In this case - The project .iml file still shows the old name and so does the .name file under ".idea" folder.
I also get this error:
检测到不支持的模块:以下模块不支持编译:.不幸的是,您不能在一个项目中拥有非Gradle Java模块和Android-Gradle模块.
B.使用F6选项,但不会复制.我认为这会影响整个项目,但这不是解决方案.
B. Using F6 option ,but it does not copy. I think it moves the entire project, which is not the solution.
推荐答案
重命名项目时,以下对我有用:
The following works for me when renaming the project:
- 关闭Android Studio
- 删除项目根目录中的* .iml文件
- 删除.idea目录中的所有内容,但 workspace.xml和tasks.xml 除外.
- 将项目的根目录重命名为新的项目名称
- 重新启动Android Studio并从重命名的目录中导入项目.
- Close Android Studio
- Delete the *.iml file(s) in your project's root directory
- Delete everything in the .idea directory except workspace.xml and tasks.xml.
- Rename your project's root directory to the new project name
- Restart Android Studio and import the project from the renamed directory.
注意:如果您不担心丢失工作区设置(窗口大小等)并且没有任何任务,则可以完全删除.idea目录.
Note: If you don't care about losing your workspace settings (window sizes, etc.) and you don't have any tasks then you can just delete the .idea directory entirely.
这篇关于关于在Android Studio中重命名Android项目(基于Gradle)的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!