Accepted answer

as usual, by pressing f2 on the package name, you can rename or change the package name, and also by right-clicking and then select rename option, you can change or rename the package name.

when you press f2, it will show you the dialog box as:

alt text

in this dialog, don't forget to check the "update references" checkbox because by making "check" to this check-box, it will make changes to all the references of the package which are referred by other components of project.


just get far manager and search through for the old name. then manually (in far manager) replace everywhere. sadly, this is the only method that works in 100% of the possible cases.


i had big trouble with this too.

i renamed the project and the package via refactoring, but it rendered the app useless. i renamed it back to the original and used the android tools to rename the package and this worked, but my package folder and classes had the old name.

i then refactored the package folder. now the app wouldn't run. my manifest was a mess. it doubled up my launcher name for example, i fixed that, and i had to manually edit all activities.


renaming an application- the complete guide

**a) for changing just the application name
   (app name which is displayed below icon)
    in the manifest.xml file, in <application tag, 
    then do the same in all the <activity tags        

  b) for changing everything 
   (folder names, package names, refrences,app name, etc.)
  *1) renaming package names in gen folder and manifest.xml
      right click on your project
      android tools- rename application package

  *2) renaming package names in src folder 
      expand src folder, click on package (single click) 
      press alt+shift+r
      check update references and rename subpackages      
   3) renaming the app's main folder (optional)
      click on the application's folder (single click)
      then press alt+shift+r 

   4) renaming application name- refer "a)"**


ok here's what i had to do:

problem: i had a base project that i wanted to use as a starting point for several other projects that would be in the same workspace as the base project. the base project was already under git control in my own local repo. it was time to duplicate the base project, "mybaseapp", to become the starting point for "mykillerapp."


  1. i just duplicated the overall mybaseapp directory as mykillerapp and had the two directories side-by-side.
  2. i edited file mykillerapp->.project and changed the name from mybaseapp to mykillerapp. (this was necessary for step 3 to work.)
  3. i opened eclipse and did a file->import of mykillerapp (i left out some details about how to use the import menu, but click around, you'll figure it out.)
  4. i right clicked on mykillerapp in the package manager and chose android tools->rename application package to mykillerapp. i checked all the options for renaming except the last checkbox about non-java files.
  5. i highlighted src->com.myname.mybaseapp in the package manager and did an f2 to mykillerapp. then i did the same to a few classes including my opening activity class thing that goes into your androidmanifest.xml file.
  6. i had to update a few function call names but the compiler pointed them out to me handily.

thus i had a new project derived from a base project with no nomenclature left over from the base project and it was in its own local git repo.


following worked for me in eclipse:

go to androidmanifest, search and replace old package name with new one and update everything when saving. go to your root project package then press f2, write new name, and check update references and rename subpackages check boxes. after this everything was red in project (complaining about r import for every java file) because it wasn't changing closing tag of my custom view-s in layout xmls. after i changed these manually, everything was back to normal. that is it.


press f2 and then rename it (or right click on the project and select rename). it changes wherever that package is declared in your project. it's automatically renamed all over.


goto the src folder of your android project, and open the java file.

change the package to

it gives you an error like this

the declared package "" does not match the expected package "

to fix this problem, select move to and delete the old package folder.

next step: go to androidmanifest.xml and change package="" to package="".


this worked perfectly for me (simple text replace):

go to search -> file

containing text: old pakage name

file name pattern: *

scope: workspace

press replace

replace: new package name

now your project is full of errors.

click your package in project explorer and press f2 (rename).

fill in the new package name and check all checkmarks.

press preview.

click ok.

wait for eclipse to refresh. if there are still errors, clean all projects in the workspace:

project -> clean


none of this worked for me until i combined the two answers mentioned in this post.

step 1: right click on the project -> select android tools -> rename application package. (this will change all the files in the gen folder and in androidmanifest but will not change the package name in the src folder so i followed step 2)

step 2: inside src folder right click your package name -> refactor -> rename -> enter the new name that you entered in step 1.

just to make sure check androidmanifest if there is still the old package name and replace with the new one (in my case inside the "uses-permission" tag).

then close the eclipse and reopen it. uninstall the app from your device and install it again and everything should be working fine.

hope this helps and saves your time.


just right click on the project name and select android tools and click rename application package name and rename it. it's only for android projects.


to change the app name when in android, go to res/values/strings.xml and change app_name to what you want.


 right click on your project name and select android tools , then click 
 rename application package, then change your project name click ok and 
 click finish.

enter image description here

enter image description here

enter image description here


one extremely important notice:

never use a direct package names as in something similar to passing a string value containing the package name. use the method getpackagename(). this will make the renaming dynamic. do whatever to reach the method getpackagename().

in eclipse juno, the correct way of renaming is:

  1. go and edit the manifest.
  2. remove every old package name in the manifest.
  3. put instead of the old package name, the new package name in every location inside the manifest. you might have classes (activities that is) that need direct package name references.
  4. save the manifest.
  5. then right click the package name inside the project.
  6. select "refactor".
  7. select "rename".
  8. type the new package name.
  9. select "update references".
  10. press ok and you're done and watch out also what should be done to replace the new name.
  11. don't forget to also update the layout xml files with the new package name. you might have a custom view. look for them.


none of these worked for me, they all introduced errors.

the following worked for me:

  • right click the project and select android tools >> rename application package.
  • enter the new package name
  • accept all the automatic changes it wants to make
  • say yes to update the launch configuration


this is a bug in the eclipse android tools.

to fix: right click on the project, go to android tools -> rename application package.

and also check androidmanifest.xml if it updated correctly. in my case it didn't, and that should solve this problem.

Related Query

More Query from same tag