Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Nathan Pickard
10,950 PointsTrying to publish "Fun Facts" app
I am trying to upload new APK to production in Google Play publishing. However, I'm getting an error message when I'm trying to upload my APK. It says:
"You need to use a different package name because "com.example" is restricted.
What gives and how can I change this?
3 Answers
Seth Kroger
56,416 PointsThe package name is supposed to be the reverse of your or your company's domain name. If you don't own one, things can be a little tricky. The package name also needs to be unique, which makes com.example a bad choice because it's overused.
To change the package name for your app right click the package in Android Studio and Refactor -> Rename. You may need to go through the manifest manually too.
If you don't own a domain I'd suggest starting with something other than com., net., etc. I use seth_k.app.APPNAME for my app package names.
Joseph Ambrose
6,629 PointsYour package name is com.example for your app. You will need to go through the project and change to something else. Typically it would be your or your company's name. For example:
com.nathanpickard.funfacts
This package will be in manifest, folder name, and at the top of java files. You can try refactoring the folder name and it might/should pick up the package names on the java files but you will need to go through them and check.
Nathan Pickard
10,950 PointsThanks guys, I changed the package name via the manifest, ran the wizard again, and the app published with no hiccups. I'll be sure to change the package name at the start of a new project to avoid this again.