-1

I know how to change the package name, suppose from com.example.abc to com.xyz.abc but here in my project the package name is com.abc and I want to change it to com.xyz.abc. How can I do that on Android Studio? Could someone help me with it?

This question is not a duplicate of another post that was linked to it as in my case there is no middle name.

My question differs from the other questions that were linked to my post, in my case there is no middle name. Anyways, I have already fixed the issue.

Codist
  • 737
  • 8
  • 23
  • 1
    Does this answer your question? [Rename package in Android Studio](https://stackoverflow.com/questions/16804093/rename-package-in-android-studio). Check [this answer](https://stackoverflow.com/a/18637004/2408342). – Roshana Pitigala Aug 16 '21 at 11:17
  • Can I ask why the linked post doesn't work for you? It shouldn't matter that there's a middle name, you should be able to rename the package the same way. – Ryan M Aug 16 '21 at 23:37

2 Answers2

1

Create a package xyz under com folder. Then Move all the directory which is inside com folder to xyz folder.

Kunu
  • 5,078
  • 6
  • 33
  • 61
  • I get the following error when I rebuild the project. `> Task :app:processDebugGoogleServices FAILED Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package name 'com.xyz.abc'` – Codist Aug 16 '21 at 11:38
  • OK, I fixed it. I have to change the package name in the google-services.json file manually. – Codist Aug 16 '21 at 11:48
0

Rename xyz to abc. You will have com.abc.abc. Refactor > Move all files from child abc to parent abc folder. Finally, delete child abc folder.