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
Sam Ford
2,633 Pointserror: package R does not exist!?
Hi, everytime i try to run my app i am just receiving the gradle build error - error: package R does not exist! Is there a way to solve this??
1 Answer
James Simshaw
28,738 PointsHello,
I'm guessing you're breaking up your project into seperate packages. If so, you are going to need to import the R class(which is automatically generated when you build your project).
For example,
import com.example.R;
if your base package is com.example
James Simshaw
28,738 PointsJames Simshaw
28,738 PointsAlso, I beleive Android Studio does this automatically for you if its necessary if you run the optimize imports command.