Android: problems with R after importing v7 appcompat

I imported the v7-appcompat support library according to the instructions on the Android developer site and ran into a missing R problem that many other users encountered. I read several similar questions posted here and tried what was suggested, but I still get the missing problem R. I re-imported the appcompat library, cleaned my project, restarted eclipse, changed my minimum and target SDK both in the manifest and in properties, and still has the same problem. Exact error regarding R: "R cannot be resolved by a variable."

In addition, the attrs xml file in the values ​​folder has an error that also appeared when I added the library, but no one mentioned it. This is the code in the file:

<declare-styleable name="ButtonBarContainerTheme"> <attr name="buttonBarStyle" format="reference" /> <attr name="buttonBarButtonStyle" format="reference" /> </declare-styleable> 

The Eclipse error gives me the error “Attribute” ButtonBarStyle already defined. ”Any help with this would be greatly appreciated!

0
android eclipse android-support-library appcompat
source share
1 answer

It looks like your style is listed in the RES folder of your project. This style is also defined in the v7 support library, so it is now defined twice. Remove it from your RES file.

See this post: Create errors after adding fullscreen mode in Android Studio

+3
source share

All Articles