安卓:问题有R导入V7应用程序兼容性后, [英] Android: Issues with R after importing v7 appcompat

查看:280
本文介绍了安卓:问题有R导入V7应用程序兼容性后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我进口V7-应用程序兼容性支持库下面的的 Android开发者网站,跑进失踪ř问题,许多其他用户都遇到过。我已经通过<读href=\"http://stackoverflow.com/questions/18293088/adding-support-libraries-to-android-project\">several类似<一个href=\"http://stackoverflow.com/questions/20523026/cannot-add-android-support-v7-to-my-project-build-path\">questions用户<一个href=\"http://stackoverflow.com/questions/20900832/java-lang-noclassdeffounderror-android-support-v7-appcompat-rstyleable\">have发布<一个href=\"http://stackoverflow.com/questions/18563441/after-setting-up-android-support-v7-appcompat-r-java-is-missing\">here,并试图什么建议,但我仍然得到失踪ř问题。我已经重新导入的应用程序兼容性库,清理我的项目,重新启动Eclipse中,既在清单和属性改变了我的分和目标SDK,仍然有同样的问题。对于R上的确切的错误是R不能解析为一个变量。

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".

此外,在价值观文件夹中的attrs xml文件有错误也出现了,当我加了库,但没人提到。这是文件中的code:

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>

Eclipse是给我的错误是错误:属性'buttonBarStyle已经被定义。任何帮助,这将大大AP preciated!

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

推荐答案

这听起来像你设置样式在你的工程RES文件夹中定义。这也设置样式在V7支持库定义的,所以它现在定义了两次。从RES XML中删除。

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.

请参阅这篇文章:<一href=\"http://stackoverflow.com/questions/19632137/build-errors-after-adding-fullscreen-activity-in-android-studio\">Build Android Studio中添加全屏活动

这篇关于安卓:问题有R导入V7应用程序兼容性后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆