CoolMind
CoolMind

Reputation: 28875

Change applicationId or also package name?

Assume there is applicationId com.example.application in build.gradle. This name is shown after "https://play.google.com/store/apps/details?id=". I want to change it to another, for instance, "org.domain.app". Should I also change package name in AndroidManifest and rename package folder? In https://developer.android.com/studio/build/application-id.html it is said that if have different applicationId and package name, there may be a problem with WebView. Also there and in https://blog.stylingandroid.com/package-name-vs-application-id/ it is said that after build applicationId is copied to AndroidManifest and change package attribute.

In order to have different APK's for each flavor applicationId can vary while package name remains the same.

So, have I set package name to applicationId? If not, what problems can occur?

Upvotes: 3

Views: 3578

Answers (2)

Yousha Aleayoub
Yousha Aleayoub

Reputation: 5715

The applicationId in Gradle build file will overwrite the packagename in the Manifest file.

Why do we need both of them?

  • Because packagename is designed to organize your source code and your R class.
  • And applicationId, is used in your device(application's settings), in Play Store and creating build variants.

More information in docs: https://developer.android.com/studio/build/application-id.html

Upvotes: 2

Szymon Chaber
Szymon Chaber

Reputation: 2186

You cannot change applicationId nor package name of the app you publish, according to this article.

You can, however, change them for any flavor you like as long as they are not published according to this article

Upvotes: 1

Related Questions