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 Blog Reader Android App Using Intents to Display and Share Posts Opening a Webpage Within the App

Jeremy Broutin
Jeremy Broutin
1,951 Points

Cannot resolve symbol 'R' when adding an activity class

When adding the BlogWebViewActivity class to the project, an error appears in the MainListActivity : Cannot resolve symbol 'R', every time a resource is called. I looked at the web and a couple of threads on stackoverflow.com, and already clean project (Build > Clean Project), without any success.

My Gradle console (I'm using Android Studio) shows a FAILURE: Build failed with an exception, with the following note as what went wrong:

  • What went wrong: Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version L declared in library com.android.support:support-v4:21.0.0-rc1

What should I do to solve this issue and be able to pursue the course (right now, the project doesn't get built and cannot run on the emulator).

Thanks in advance.


Jeremy Broutin
Jeremy Broutin
1,951 Points

Ok it looks like I solved the problem, thanks to this stackoverflow thread: http://stackoverflow.com/questions/24438170/manifest-merger-failed-uses-sdkminsdkversion-14

Go to File > Project structure, Click on Dependencies tab, Remove the com.android.support:support-v4:+ compile, Add com.android.support:support-v4: compile, Apply

The project now gets built and the error on resolving 'R' has disappeared.