错误:属性" ***"使用两个库项目在Android的时候已经被定义属性、定义、错误、两个

2023-09-05 06:02:07 作者:巴黎街头盛开的向日葵

我用 Android的支持-V7-appcompat 在我的Andr​​oid项目库。现在,我想包括 actionbarsherlock 作为另一个库项目。当我添加第二个库,它提供了这么多的错误,如下面

I'm using android-support-v7-appcompat as a library in my Android project. Now I want to include actionbarsherlock as another library project. When I add the second library, it gives so many errors like below

android-support-v7-appcompat\res\values\attrs.xml:476: error: Attribute "attributeName" has already been defined

通过改变一个属性值和它的相关code段是我已经尝试了一种解决方案。但是,当有喜欢上面的近80行,它会变得一片狼藉。有没有其他办法可以解决这个问题呢?

By changing one attribute value and it's related code snippet is a one solution that I've tried. But when there are nearly 80 lines like above, it will get a messy. Is there any other way I can solve this issue?

推荐答案

解决这个问题的正确方法是在所有相关项目和库项目更新Android的支持库。在我来说,我已经使用Android的支持库,也是库项目来实现我的应用程序之一。当我更新这两个库,问题解决了。更新Android的支持库的方法是;

The correct way to solve this problem is by updating Android Support Libraries in all relevant projects and library projects. In my case I've used Android support library and also one of the library project to implement my application. When I update both libraries, the problem solved. The way of updating Android support library is;

右键单击该项目 选择 Android的工具的在弹出的窗口中 选择 添加支持库的