What a package name actually is
Every Android app has an applicationId — usually called the package name — and it is the one thing about your app you can never change. It is how the Play Store identifies your listing, how Android decides whether an install is an update or a new app, and how the system keeps your files separate from every other app on the device. Publish under com.mycompany.shop and that string is yours for as long as the listing exists. Get it wrong and the only fix is a new listing with zero installs and zero reviews.
The rules Gradle enforces
- At least two segments separated by dots —
com.exampleis the minimum shape, three is conventional. - Each segment starts with a letter, then letters, digits or underscores. A segment cannot begin with a digit, which is why
com.123studio.appfails. - Lowercase throughout. Uppercase is technically legal in Java packages but breaks on case-insensitive filesystems and is rejected by convention everywhere.
- No hyphens, spaces or accented characters.
my-appbecomesmyapp. - No Java reserved words as a segment:
com.new.app,com.class.appandcom.int.appall fail to compile.
The validator above checks every one of these, which is worth doing before a build rather than after a five-minute Gradle run.
The rules Google Play adds on top
Play refuses anything starting with com.example — that prefix is reserved for sample code and tutorials, and it is the single most common upload rejection for first-time publishers. Names containing android as a segment are similarly reserved by the platform. And once a package name has been used on Play, it is gone forever: even if you delete the app, unpublish it, or close the account, nobody — including you — can ever upload under that name again.
Reverse domain naming, and what to do without a domain
The convention is your domain backwards, then the app: example.com plus a shop app becomes com.example.shop. The point is collision avoidance — because you control the domain, nobody else will legitimately claim that prefix. It has nothing to do with where the app is hosted, and no DNS lookup ever happens.
If you do not own a domain, the accepted fallback is io.github.yourusername.appname, which borrows the uniqueness of your GitHub account. Avoid inventing a company-sounding domain you do not own — if someone later registers it and publishes under the same prefix, you have a conflict you cannot win.
Choosing well the first time
- Leave room to grow.
com.acme.appis awkward once you ship a second app.com.acme.shopandcom.acme.trackerage better. - Do not encode versions or years.
com.acme.shop2024looks wrong forever, and you cannot rename it. - Do not encode the platform.
com.acme.androidappis redundant; the Play listing is already Android. - Keep it short and typeable. It shows up in crash reports, deep links, file paths and support emails.
- Match your brand, not your current website. Sites get redesigned and domains change hands; the package name cannot follow.
Package name vs. application ID
They started as the same thing and are still identical in most projects, which is why the terms get used interchangeably. Strictly, the package name is the Java/Kotlin namespace your source files live in (namespace in modern Gradle), and the application ID is the identity Android and Play use. Modern Gradle lets you set them independently — handy when you want a .debug suffix so a debug build installs alongside the release one. When people ask for your app's package name, they mean the application ID.