390

This did the trick for me:

  • Close android studio
  • Change project root directory name
  • Open android studio
  • Open the project(not from local history but by browsing to it)
  • Clean project

If your settings.gradle contain the below line, either delete it or update it to the new name.

rootProject.name = 'Your project name'

Edit:
Working in all versions! Last test: Android 3.2.1 Jan 2019

  • This is my solution. The .idea folder is modified everytime the root folder name changed. It's better not to touch to .idea folder's content. – Yen NQ Apr 9 '15 at 2:46
  • 6
    A new .iml files is then created, can I safely delete the old one? – Leon Sep 18 '15 at 10:10
  • 5
    @Leon Yes you can! – Ilya Gazman Sep 18 '15 at 11:06
  • Please: What is the "root" directory. I've been trying to get a simple project renamed for days. Searching everywhere. No solution has worked for me. I'm porting a project from iOS. NOT enjoying Android at all. Nothing seems easy. TIA – user1204493 Nov 22 '16 at 0:36
  • If your "run" button gives an error about not being able to install the app after you do this, then you could still get it to work by disabling instant run (file > settings > build, execution, deployment > uncheck enable instant run, android studio v 2.3). – Peeyush Kushwaha Mar 5 '17 at 11:28 
  • 5
    Still works (Android Studio 2.3). Had to do "Clean Project" afterwards, else emulator crashes on "installing apk" – allofmex Mar 27 '17 at 13:42 
  • 1
    "Clean Project" is an important last step - as @allofmex pointed out. Otherwise Android Studio works with the outdated path to the generated APK file and it is not possible to install it (adb install) on device. – thomasb May 23 '17 at 13:26
  • @thomasb updated – Ilya Gazman May 23 '17 at 16:20
  • 8
    I don't know about this. If you do a search for your old project name with Ctrl+Shift+F, there are still a lot of references to it. – Suragch Sep 5 '17 at 7:32
  • 1
    Not a full solution. As Suragch says, leaves many references to old name – drod Nov 11 '17 at 21:02
  • Just tried it on Android Studio 3.0.1, still works. Didn't even need to do the "clean project". The old .iml file is deleted automagically – SOERGI Dec 15 '17 at 15:57 
  • @Suragch Same... – Denny Feb 15 '18 at 0:32
  • Worked like a charm!! – Akay Mar 26 '18 at 8:28
  • I had an .idea/.name file which needed to be updated as well. – Magnus Mar 26 '18 at 8:52
  • 1
    still working. Android 3.1.2 June'18 – malarres Jun 22 '18 at 4:01
  • 1
    Only changing rootProject.name works. Should be the accepted answer. – Borzh Oct 26 '18 at 19:13 
  • the package and application id are not updated – firion Nov 21 '18 at 8:08
  • Still working on Android Studio 3.2.1 – Pabitra Padhy Jan 7 at 10:57 
  • Worked perfectly for me - Android Studio 3.3.1, Feb 21 2019. – tfrysinger Feb 21 at 23:58
  • 3
    don't forget to change app_name in strings.xml, otherwise it will build the apk with the old name – shabby Mar 5 at 10:16
  • @shab Could you then run Find/Replace to replace all instances of the old name in the project files? Incl. app_name? – n00dles Apr 9 at 19:58 
  • Package name, app name and some other files names aren't changed. – Tamim Attafi May 17 at 7:30
  • Still working in 2019 using Android Studio 3.4.1. After performing the steps on this answer I also had to do "File -> Sync Project with Gradle Files" update the Run/Debug configurations – Leo Jul 12 at 6:41
  • Does not work.3.4.2 – MSeiz5 Jul 19 at 8:37
  • Running "Clean Project" is absolutely required. Without this, the old name will appear in the list of projects when you start up Android Studio. I'm running Android Studio 3.5. You would think that Google would fix this and do an automatic clean when renaming a project. – AndroidDev Aug 25 at 7:15 



요약 : 본문 내용 적용 => string.xml 에서 프로젝트 이름 변경, file - project structure에서 application name ****.****.*** 식으로 되어있는 이름 변경.

+ Recent posts