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

doing the Android Development Track. When I try to run the first app "package R does not exist". What do?

Have followed the steps exactly. First time running app and I get this error.

6 Answers

THANK YOU. Running the Update on Eclipse seems to have solved the problem.

Excited to continue the course now haha

This has happened to me twice. The R.java file just flat out goes missing. (I end up copying and pasting most of the code into a new project.)

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Do you get any errors when it disappears? Here's one suggestion you can try: http://stackoverflow.com/a/17314800/475217

When I'm use the findViewById(R.id.someId) method there is no R file so I get an error. That's all.

I think it's the same problem as Thomas' because in the Fun Facts project there are 3 findViewById() calls which would explain the 3 errors. The fourth error is just saying the app compilation failed.

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Looks like something isn't building correctly in your project. Do you get any kind of errors or warnings in any of the panes at the bottom of Android Studio? What happens if you click on Build > Make Project?

"Gradle build finished with 4 errors" "'Cannot resolve symbol R"

I want to say it's something going wrong with my java installation because the javac -version command still returns an error...

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Okay, click on the Gradle Console in the lower right to see what Gradle errors you have. It could definitely be related to a Java error, but hopefully the gradle errors will help track it down. (You should have other errors running Android Studio if something is wrong with Java.)

It's three "package R does not exist"s and one "Error:Execution failed for task ':app:compileDebugJava'.

Compilation failed; see the compiler error output for details."

Ben Jakuben
Ben Jakuben
Treehouse Teacher

I've seen that error, but don't know exactly what is causing it without some code. Can you paste in the contents of your file build.gradle in the app module of your project?

Which video are you at? Have you changed any code, or is it failing to run the very first time?

I'll try that later this afternoon.

This is the very first build. No code has been altered. It fails to run from the very beginning.