I imported the v7-appcompat support library following the instructions on the android developer site, and ran into the missing R issue that many other users have encountered. I've read through several similar questions users have posted here, and tried what was suggested but I'm still getting the missing R problem. I've re-imported the appcompat library, cleaned my project, restarted eclipse, changed my min and target SDK in both the manifest and properties, and still have the same issue. The exact error regarding R is "R cannot be resolved to a variable".

Also, the attrs xml file in the values folder has an error that also showed up when I added the library but nobody else has mentioned. This is the code in the file:

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

The error Eclipse is giving me is "error: Attribute 'buttonBarStyle' has already been defined". Any help with this would be greatly appreciated!

有帮助吗?

解决方案

It sounds like your styleable is defined in your project RES folder. That styleable is also defined in the v7 support library, so it is now defined twice. Remove it from your RES xml.

See this post: Build errors after adding fullscreen activity in Android Studio

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top