Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Eclipse] Renaming the main package of an Android project
Droid Offline
Android Developer

Postări: 43
Alăturat: Dec 2011
Reputație: 0
Aprecieri acordate: 1
Primit 73 aprecier(i) în 17 post(ări)
[Eclipse] Renaming the main package of an Android project
Disclaimer: As usual, there is more than one way to achieve a certain goal. The current tutorial demonstrates only one of those, and is open to discussion and improvements.

Note: There are other ways to rename packages in Eclipse, that one would expect to be easier (eg. Android Tools -> Rename Application Package) but from the tests conducted, personally none of them worked as expected.

1. Go to the Project menu and uncheck Build Automatically.


2. Delete everything form the gen folder.


3. Delete everything from the bin folder.


4. Open the src folder, right click on the main application package and select Refactor -> Rename.


5. Input the new package name and make sure all the boxes are checked. Click on Preview.


6. Click OK in the preview window.


7. Open again the Project menu and check Build Automatically.


Note: It can happen that after performing step 7. you don't get the launch configuration dialog, but instead see errors like "parser exception" or "error in XML file".


Fix: Open your manifest file and check for missing quotaton marks. After you fixed the problems and save the file, you should see the dialog from step 8.


8. You should see a message about updating your launch configuration. Click on Yes.


9. Open the manifest and your source files and make sure all the references have been updated.
Finally run your application in order to make sure everything is OK.


10. Done.
(Acest post a fost modificat ultima dată: 28-05-2012, 12:19 PM {2} de Droid.)
05-03-2012, 12:54 AM

User(s) browsing this thread: 1 Guest(s)