1

I'm trying to create an app ie "1abcxyx". When i create the project in Android studio's.

Ex.

App name:1abcxyz

Company domain:1abcxyz.com

Package name: com.1abcxyz.1abcxyz

It creates the project location but the "next button" is grayed out. A disclaimer comes up and says I cant have # in the package name.

I havent found a way around this.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Victor Winzer
  • 41
  • 1
  • 7

1 Answers1

6

From the documentation about naming packages in Java:

In some cases, the internet domain name may not be a valid package name. This can occur if the domain name contains a hyphen or other special character, if the package name begins with a digit or other character that is illegal to use as the beginning of a Java name

This means you can't use a digit as the first character of a package (or a class, interface or variable name, for that matter).

To clarify, you can name your app 1abcxyz, it's only the package name that cannot start with a digit (you could use oneabcxyz instead of 1abcxyz for example). Having a package name different from your company's website should not influence communications between your app and your company's servers.

2Dee
  • 8,609
  • 7
  • 42
  • 53
  • Thanks for answering my question: So there's no way for me to go around this and name the app "1abcxyz"? – Victor Winzer Jan 06 '16 at 14:11
  • If memory serves, there's no issue in having your app name start with a digit, but as far as package names go, no, I don't think there's a way to have it *start* with a digit. I would use `oneabcxyz` instead of `1abcxyz`, or something like that just for package name. To the users of your app, package names should only be visible in the url of the Play Store page anyway. – 2Dee Jan 06 '16 at 14:17
  • Thanks: so i can name my app "1abcxyz" and change/edit the package name. The only problem might be the domain name is "1abcxyz.com" if i change it to "one" will it stop me from fecthing the data between the app and website? – Victor Winzer Jan 06 '16 at 14:21
  • 1
    Always glad to help ! And hopefully you won't let those blind downvotes get you down, there really was no reason for people to do this since IMHO your question was clear, well-worded and could be useful to others, but you know how internet gets sometimes... Still, there are enough bad questions to go around without needing to downvote this one. – 2Dee Jan 06 '16 at 20:32
  • I agree. Thanks for the support! – Victor Winzer Jan 08 '16 at 17:03