Android Refactor Package Name

How to Solve Error:Execution failed for task No matching client found error Android Studio Java

This simple tutorial may help you to fix the following android studio error

Go to your app build.gradle file, change the applicationId to the new package name and sync file. Go back to the options menu and compact the middle packages. You have successfully changed your app package name. If there’s a much better way, I would love to hear about it.

Error:Execution failed for task ':app:processAllcategoriesDebugfreeGoogleServices'. No matching client found for package name 'com.my.app.package.name.debug'

Open Android Studio project, Select package name or Java, Click the gear icon. STEP 2 Deselect Hide Empty Middle Packages. This breaks your folder structure into parts. Karena package name merupakan ID sebuah aplikasi maka untuk keperluan upload ke Google Play kita harus mengubahnya agar diterima karena package name yang sama akan ditolak untuk diupload. Mengubah package name bisa juga digunakan untuk mengkloning project Android Studio. To rename your package name, all you have to do is go to your AndroidManifest.xml file, put your mouse cursor in front of the part of the package name you want to change. Right-Click Refactor Rename.

The most common causes for this error to occur is because you have changed your existing app project package name id, changed package id that already had admob integration, or played around with google-services.json file, so the app id is not matching in the google-services.json file.


here is a way to fix it.

In android studio, select Project Files window and then select app folder. then navigate to google-services.json

Open google-services.json file

Change the package name in this file, see the line marked in Red, type there your app package name id, example; com.myapp.android.

Sync or refresh your project after doing this, your error should be fixed now.

Update: If you are new to android development, or just can’t fix this error, i can fix it for you for a small fee of US $2 (₹120 indian rupees). Just send me your project through email or google drive, i will fix your project and send it back to you. You can pay me through Paypal, Direct Bank Transfer (NEFT,IMPS,UPI) etc. i do this service to all countries. For more details, contact me through [email protected] or [email protected]

Related

While developing any Android application, generally it is the tendency of Android app developer to keep the PackageName as it is and not to change it. But at times, while uploading an application on Play store or due to some other constraints there could be a need to change the PackageName of Android application or some packages in the application.

Changing PackageName is a crucial part of any Android application as many of the core libraries and R.java file depends on the package name. Also, changing the package name was bit easy task for the Eclipse users, but this might not be the same in Android Studio as the package level names are not displayed in Eclipse style. i.e. In Eclipse, the packages are displayed with full parent hierarchy, but in Android Studio, it is displayed in a folder level hierarchy, so sometimes it looks bit difficult to change the PackageName.

So in this article, I have tried to share some important guidelines to make this process easier. This is already documented in the Android Studio guide which is so huge that most of the time it is difficult to read everything of it. The purpose of sharing this feature separately is to highlight the steps, so it is easy for all Android developers to quickly change the PackageName when needed.

Below are the steps for changing the PackageName in Android studio.

  • Lets say, I want to change package name com.mycompanyname1.data to com.mycompanyname.data.
  • Click setting icon from Project explorer and check the Flatten package option.
  • Now again click on setting option and uncheck Hide Empty Middle Packages.
  • So now package name gets divided in different sub-package like com, com.mycompanyname1, com.mycompanyname1.data under java directory.
  • Right click on com.mycompanyname1 package name and click option Refactor->Rename option (Alt+Shift+R) then rename packagename dialog box opens up, just change the package name as you want. For current example, we changed mycompanyname1 to mycompanyname.
  • Click on Refactor button in dialog box.
  • Click on Do Refactor at bottom.
  • Android studio automatically changes package name in whole application except build.gradle.
  • Open build.gradle file under application, rename package name manually.
  • Now, again click on setting option and uncheck Flatten packages option.
  • Sync the application again and the code will be refactored according to new package.

For more clarity, you can also refer to the video shown below,

Hope this makes your life more easy now, to change the package name during Android app development. 🙂

If you have any questions, then comment box is open for it.

Author : RajMT

About the AuthorTags
  • Android Team @ WeblineIndia

    Android Refactor Package Name Tags

    We are Android experts @ WeblineIndia.We have developed lots of Android apps for various domains like - Business, Social, Medical, News, Sports, Education, etc. We also have expertise in custom SDK development.Following well defined standard development processes, coding standards, tools and techniques, it has always helped us to provide best mobile apps to our clients. Our main focus has always been to exceed client expectations and deliver easy to use technically strong apps. On the side, we also love contributing back to the community.Contact us if you want to develop an Android app.

    Android Refactor Package Names