如何在android studio中移动和重命名项目? [英] How to move and rename a project in android studio?

查看:34
本文介绍了如何在android studio中移动和重命名项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这应该是一个非常简单的问题:)

This should be a really simple question :)

我有一个运行良好的项目.现在我想重命名它并更改项目文件夹的路径.首先看起来很简单:右键单击->移动"和重构/重命名".

I have a project that works fine. Now I wanted to rename it and to change the path of the projectfolder. First it seemd simple: right click -> "move" and "refactor/rename".

在移动并重命名我的项目文件夹和我的 apk 模块后,项目结构与以前不同.我的项目库已包含两次.我查看了 '.iml' 文件,看到包含了以前的路径 - 所以我改变了它.在此之后,我可以通过命令行编译我的项目,但不能使用 IDE.在那里我收到了这个错误:

After moving and renaming my project folder and my apk modul there was not the same project-structur as before. My project libs have been included twice. I looked in the '.iml' files and saw that the previous path was included - so I changed this. After this I could compile my project over the command line but not with the IDE. There I got this error:

NullPointerException: no project directory specified

移动和重命名项目的默认方式是什么?我通过创建一个新项目并复制所有文件来解决我的问题,但是知道这个问题"的解决方案会很酷.

Whats the default way to move and rename a project? I solved my problem by making a new project and copying all files, but it would be very cool to know the solution of this "problem".

Origin 项目结构:

Origin Project-Structure:

MyProject
--- libraries
--- MyApp

搬家后:

MyProject
--- MyProject (new path)
--- MyProject (old path)

我想我要做的不仅仅是复制项目.不知何故,我必须指定新"项目,不是吗?

I think I have to do more than just copy the project. Somehow I have to specify the "new" project, havn't I?

推荐答案

在 Android Studio 中关闭项目(文件 -> 关闭项目).移动项目并通过移动其主文件夹/目录来重命名.从 Android Studio 打开新项目(文件 -> 打开)

Close the project in Android Studio (File -> Close Project). Move the project and rename it by moving its home folder/directory. Open the new project from Android Studio (File -> Open)

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

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