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

Android Build a Simple Android App (2014) Getting Started with Android Running the Fun Facts Project

I also had an error that read, "INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]" when I tried to run on the emulator.

I read the answers to the other questions on the same topic and realized that I had used a capital letter in my company name. I ended deleting the entire thing and starting over, which worked. Before I did that, I attempted to change the package name in the AndroidManifest.xml file, but that only created new errors. How could I have avoided deleting the project and starting from scratch? Also, when I make a change, do I need to compile the code or does running the app automatically do that?

2 Answers

When you say...you changed it in the manifest file...do you mean refactor or just went and edited it?

I tried refactoring, but am unsure what that does. What is refactoring?

It depends. If you edit a variable without refactoring, it affects only that specific variable that is in the file you are editing. If for example you are using that variable on other places in the file or in another .java file, that changed won't affect those variables but if you "refactor" it changes the variable wherever it exists as opposed to changing only the one you are editing. That's my explanation of it. Another way to change the package name is this.

Boris Vukobrat
Boris Vukobrat
4,248 Points

Your original package name is in .java files, at the first line. I would use, at this point, the same package name in manifest. It is not quite clear what else have you done there, and what could be the problem, but a package name can contain uppercase letters, numbers and underscores. The only restriction is first character in each name part should be a letter.

Good practice is to 'clean' or 'rebuild' code (Build > Clean ...), after some more altering, and then 'save', before run on a device. However, running the app automatically builds it.

Java names always change using Refactor option (caret on the name > shift+F6). Refactoring restructures your entire project, qualified by your change even tiny one, in order to preserve external projects' execution. In other words - you change code but don't change output (behavior). It also can affect values in code (like Strings), same names used in comments, documentation etc...