135
The best way to solve this is going to the AndroidManifest.xml: package="com.foocomp.fooapp:
Works for me.
Also, replace in Path in Whole Project as it didn't change everything. Then Clean, Rebuild and it works --> In Android Studio / IntelliJ you should unmark "Compact Empty Middle Packages"
I found a good work around for this problem. Taking the example mentioned in the question, following are the steps for changing the package name from com.example.test to com.example2.test :
temp inside the directory example (alongside directory test).com.example and Click Shift + F6. Now it offers to rename the text example. Here you can enter the new text you want and IntelliJ will do the rest for you.temp from the file system.This idea can be used to refactor any part of the package name.
Good luck!!