Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the project name in Android Studio safely?

I want to change the project name in Android Studio. I have found some answers on Stackoverflow but it didn't work for me. Please suggest me some suitable solution.Currently I'm using Android Studio 2.3.
Thanks always :)

like image 861
Ravi Shankar Avatar asked Jul 18 '17 17:07

Ravi Shankar


2 Answers

You need to perform a few steps

  • First move to project view and click on the small settings icon on the top right corner of project view, make sure the compact empty middle packages option is checked
  • Right click on your java folder and choose Refactor>Rename>change to your desired package name and confirm Refactor
  • than you MUST also change the project id in your build.gradle file
  • double check if your android manifest.xml refactored too(android studio should take care of it automatically but check again) this is the only method that changed the project name from the base for me.
like image 134
MIKE PERETZ Avatar answered Sep 23 '22 11:09

MIKE PERETZ


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

Check this: https://stackoverflow.com/a/28324892/4161284

like image 43
sagar suri Avatar answered Sep 21 '22 11:09

sagar suri