From time to time you may find you need to rename an android package while developing in Android Studio. There seem to be several explanations around the web. The following method seems to be the method that worked the first time everytime for me. Example, change package com.example.test to com.example.testing:
- Click Project in the left sections bar → the Project Pane will open.
- Select Java under src / main of the app with the package to be renamed.
- Click the Small Gear on Project Pane top action bar → an options menu will appear.
- Uncheck the Compact Empty Meddle Packages in the options menu → the directories under java will cascade down.
- Select the package name to change (ex: test) and right click → a dropdown menu will appear.
- In the dropdown menu, select Refactor / Rename → a window will appear
- In popup window, select Rename package → a window will appear
- Enter the new package name, click search in comments & strings and search for text occurances
- Press Refactor
Refactoring should replace all needed directory names, and references within your files, producing a new package.