If you are struggling to change the package name easily, this is the article for you.
Or if not then it will help you in the future.
Android Studio has excellent refactor capabilities just by right-clicking on the file or package => Select refactor => rename => done.
However, this does not work if you want to change the package name from com.android.example => brand.com.product
The simple method consists of 3 steps:
- Copy package name => Press Ctrl + shift + R => Replace all
- Right-click on the package root (here com) => select Show in explorer => Rename to “brand” => Go inside and rename “android” => “com”
- Reopen Android Studio => Build => Clean project Then go to File => Invalidate Cahes / Restart => Select invalidate and restart.