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 trialzhenhuazhu
2,417 PointsCannot resolve symbol 'Weather' error in ActivityMainBinding.Java
At the end of this video, I received an the Cannot resolve symbol 'Weather' in the ActivityMainBinding.java class. In that class, the error occurs while importing com.teamtreehouse.stormy.Weather, where Weather is the new folder created. I also noticed that the ActivityMainBinding.java class is under the path app>generatedJava>com.teamtreehouse.stormy.databinding while the Weather folder is under app>java>com.teamtreehouse.stormy. I suspect that the import statement in ActivityMainBinding.java is looking for Weather in the wrong directory since com.teamtreehouse.stormy exists in multiple places.
1 Answer
michael lee
5,179 PointsI solved the problem by refactoring and rename the Weather package to "weather", with a lower case w. try it and see if it helps. and if it does work, i don't know the reason, haha
Lauren Moineau
9,483 PointsLauren Moineau
9,483 PointsExactly Michael, that's was the error. Package names should be in all lower case (so weather, not Weather), otherwise it can create conflicts with classes (as class names start with an upper case letter). This is what's happening here: the system is looking for a Weather class (or Interface) and can't find any when it should be looking for a weather package.