1. This page will help you to change the package name from com.itsanubhav.wordroid4 to whatever you want. For example, if you want to change com.example.app to com.awesome.game, then: In your Project pane, click on the little gear icon ( ).
  2. Change the App Name Usually, when you change the project name, you wanna change the name of your app too. Go to the res folder values strings.xml and change the appname to your new name.
  3. Change Package Name In Android Studio - Changing Package Name is a crucial part of any Android application as many of the core libraries and R.java file depends on the package name.

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.

Creating multiple APKs for different purposes.

PackageName vs ApplicationId

Android Change Package Name

Nowadays, many times we come to the situation that we need the APK with another different package name. Most of us do it easily, but sometimes we got stuck because of applicationId and packageName.We must know the difference between packageName and applicationId. And the other thing is Java package.

The following are the three which keeps us confusing:

  1. applicationId: BuildConfig.APPLICATION_ID
  2. packageName: getApplicationContext().getPackageName()
  3. Java package: BuildConfig.class.getPackage().toString()

Let’s see with an example

Preview mac for windows

The following is the snippet from the gradle of a sample Android application.

Here we will be having two different APKs.

  1. Release APK with com.mindorks.example.release
  2. Debug APK with com.mindorks.example.debug

The following is the snippet from manifest of the same sample Android application.

PackageAndroid Change Package Name

The following is the project package snippet of the same sample Android application.

So, let’s create a debug APK and see what are the values of all the three.

Read the values carefully.

The following shows the final AndroidManifest file after APK creation.

getPackageName gives the same applicationId which is created at the final moment from the gradle file and it overrides the AndroidManifest package. So the final AndroidManifest contains the same applicationId. So, the getPackageName is the same as the applicationId as the applicationId overrides the packageName in the AndroidManifest at the final moment.

But for the Java code, the package is same as the project structure. The package that is used in your source code to refer to your R class, and to resolve any relative activity, service registrations, continues to be called the package as defined in your manifest. So, the AndroidManifest should have the package same as Java package to resolve relative activity, service.

So, with the same java package, we can create any number of APKs with all unique applicationId.

But the final AndroidManifest contains the package as the unique applicationId only.

If you have to actually change the structure of your project, then you have to change your packageName in Manifest.xml.

If you rename the package name from manifest file, it will have NO impact on the applicationId even if they have the same name.

We can also create multiple APKs through productFlavors like above.

Remember, once an app has been published to Google Play store, the ApplicationId should never be changed.

So, the applicationId matters.

Happy Coding :)

Also, Let’s become friends onTwitter,Linkedin,Github, andFacebook.

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

Android Change Application Id

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

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.

Android Change Package Name In Manifest

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

Change Package Name Android Studio

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]



6817.info – 2018