【问题标题】:Android: Error:(464) Attribute "dividerPadding" has already been definedAndroid:错误:(464)属性“dividerPadding”已被定义
【发布时间】:2016-05-31 19:37:15
【问题描述】:

当我尝试调试我的应用程序时出现错误

错误:(464) 属性“dividerPadding”已被定义

build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.xxx.xx"
    minSdkVersion 11
    targetSdkVersion 22
    useLibrary  'org.apache.http.legacy'
}

buildTypes {
    release {
        minifyEnabled true
        proguardFiles 'proguard.cfg'
    }
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.code.gson:gson:2.2.2'
compile 'joda-time:joda-time:2.2'
compile files('libs/comscore.jar')
compile files('libs/FlurryAnalytics-5.3.0.jar')
compile files('libs/json-simple.jar')
compile 'com.lantouzi.wheelview:library:1.1.2'
compile project(path: ':pageStripLibrary')
}

我在添加“pageStripLibrary”后遇到了这个问题。 当我尝试调试应用程序时

    <declare-styleable name="PagerSlidingTabStrip">
    <attr format="color" name="indicatorColor"/>
    <attr format="color" name="underlineColor"/>
    <attr format="color" name="dividerColor"/>
    <attr format="dimension" name="indicatorHeight"/>
    <attr format="dimension" name="underlineHeight"/>
    <attr format="dimension" name="dividerPadding"/>
    <attr format="dimension" name="tabPaddingLeftRight"/>
    <attr format="dimension" name="scrollOffset"/>
    <attr format="reference" name="tabBackground"/>
    <attr format="boolean" name="shouldExpand"/>
</declare-styleable>

这行代码是在value.xml下自动生成的 build > intermediate>res>merged>debug>values>values.xml

【问题讨论】:

  • res中有id.xml文件吗?
  • 位于路径“Health\build\intermediates\res\merged\debug\values”下,当我尝试调试时,该文件正在生成。在 value 文件夹下,我只有 value.xml 没有其他文件。 @M D

标签: android android-studio android-viewpager android-gradle-plugin build.gradle


【解决方案1】:

请尝试从您的attrs.xml 中删除或评论(该文件位于项目“pageStripLibrary”中的res/values/attrs.xml):

    <attr format="dimension" name="dividerPadding"/>

因为它已经被support:appcompat定义了

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-12-20
    • 2016-09-14
    • 2023-04-04
    • 1970-01-01
    • 1970-01-01
    • 2013-09-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多