Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Refactoring package name breaks entire app

I am trying to refactor my package using Eclipse

org.sheehan.activity

to

org.sheehan.stocks.activity

For some reason my project just blows up when I do this and R doesn't get regenerated. How can I refactor properly?

UPDATE: I updated my Android Manifest to reflect the change. R still doesn't get regenerated. Even after a clean. The compiler is complaining about org.sheehan.activity.R

like image 528
Sheehan Alam Avatar asked Jun 27 '11 23:06

Sheehan Alam


People also ask

Does package name matter Android studio?

No it wont have any change. You follow the same steps as before but with your new package. Just upload it as a new app. That's all.

Should package names be unique?

The package name defines your application's identity, so if you change it, then it is considered to be a different application and users of the previous version cannot update to the new version. So basically if package name is com.

Can we change package name in Android after release?

From Dianne Hackborn: Things That Cannot Change: The most obvious and visible of these is the “manifest package name,” the unique name you give to your application in its AndroidManifest.


1 Answers

I resolved by:

Android Tools > Rename Package Application
like image 183
Sheehan Alam Avatar answered Sep 27 '22 20:09

Sheehan Alam