Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Renaming the package that R.java is generated in

I am using eclipse and I created a test android project and the package in the "gen" folder that contains R.java is currently called com.something.test (I thought I was just testing but build my whole app on it!)

This is referenced when loading the app and the phone sometimes displays it so I need to rename it. I tried this by clicking refactor but it regenerated it again with the old name!

Can I rename it?

like image 840
Bex Avatar asked Mar 30 '11 14:03

Bex


2 Answers

Right click your project, then Android Tools -> Rename Application Name:

enter image description here

Or, if you want to do it manually, go to your manifest file, change the package name, and make a Project Clean.

like image 141
Cristian Avatar answered Oct 17 '22 19:10

Cristian


Check the AndroidManifest.xml, there's a package attribute on the <manifest> top-level element. That is where R.java is generated and you should be careful renaming it.

like image 23
Felix Avatar answered Oct 17 '22 17:10

Felix