首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >API级别23的样式错误

API级别23的样式错误
EN

Stack Overflow用户
提问于 2015-09-24 19:35:28
回答 1查看 1.2K关注 0票数 1

一旦我将我的build.grade文件更新到API 23,我就会得到无法定位的错误,并且无法修复它们。然而,这些相同的错误不会出现在22或21。出现的错误是:

Attribute "titleTextColor" has already been defined,由于某种原因,它突出显示了colors.xml文件。在我的整个项目中没有titleTextColor的实例。当我在项目范围内搜索(cmd + shift + f)时,生成的构建文件中只会显示titleTextColor的实例。这是怎么回事,我怎么解决这个问题?

编辑build.grade文件

代码语言:javascript
运行
复制
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
apply plugin: 'play'

repositories {
    //ViewPagerIndicator AAR packaged
    maven {
        url 'http://dl.bintray.com/populov/maven'
    }
    jcenter()
    flatDir {
        dirs 'libs'
    }
}

android {

    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 23

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    publishingConfigs {

    }

    signingConfigs {

        basicRelease {

        }

        advancedRelease {

        }

        debug {
            storeFile file('publish/debug.keystore')
        }
    }

    productFlavors {

        basic {
            applicationId "com.basic"
            versionCode 1
            versionName "1.0.0"
        }

        advanced {
            applicationId "com.advanced"
            versionCode 2
            versionName "1.0.1"
        }
    }


    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'LICENSE.txt'
    }

    buildTypes {
        debug {
            applicationIdSuffix ".debug"
        }

        release {

        }
}

lintOptions {
    abortOnError true

    htmlReport true

    checkAllWarnings true
    warningsAsErrors true
}

configurations {
    all*.exclude group: 'com.google.android', module: 'support-v4'
    all*.exclude group: 'com.google.android', module: 'support-v13'
}

dependencies {
    compile 'com.android.support:support-v13:23.0.+'
    compile 'com.android.support:appcompat-v7:23.0.+'
    compile 'commons-httpclient:commons-httpclient:3.1'

    compile 'com.google.android.gms:play-services:7.8.0'
    compile 'joda-time:joda-time:2.3'
    compile 'org.ocpsoft.prettytime:prettytime:3.2.1.Final'
    compile 'com.facebook.android:facebook-android-sdk:3.23.0'
    //https://github.com/weddingparty/AndroidFloatLabel
    compile ':float-label:1.2.1.0@aar'

    //Forked from https://github.com/inmite/android-styled-dialogs
    compile 'eu.inmite.android.lib:android-styled-dialogs:1.2.0'

    compile 'com.viewpagerindicator:library:2.4.1@aar'
    compile 'com.makeramen:roundedimageview:1.2.1'
    compile 'com.squareup.dagger:dagger:1.2.2'
    provided 'com.squareup.dagger:dagger-compiler:1.2.2'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    debugCompile 'com.squareup.retrofit:retrofit-mock:1.9.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.squareup.okhttp:okhttp:2.3.0'
    compile('com.squareup.okhttp:okhttp-urlconnection:2.3.0') {
        exclude(group: 'com.squareup.okhttp', module: 'okhttp')
    }
    compile 'com.squareup.okio:okio:1.3.0'
    compile 'io.reactivex:rxandroid:0.24.0'
    compile 'info.metadude.android:typed-preferences:2.0.0'
    compile 'org.apache.commons:commons-lang3:3.3.2'
    compile 'commons-io:commons-io:2.4'
    compile 'com.crittercism:crittercism-android-ndk-agent:5.0.6'
    compile 'com.jakewharton:butterknife:6.1.0'
    compile('com.segment.analytics.android:analytics-core:3.0.2@aar') {
        transitive = true
    }

    compile 'pl.charmas.android:android-reactive-location:0.5@aar'
    compile 'com.github.amlcurran.showcaseview:showcaseview:5.1.1@aar'
    compile files('libs/appsflyer-2.3.1.16.jar')
    debugCompile 'com.jakewharton.madge:madge:1.1.1'
    debugCompile 'com.jakewharton.scalpel:scalpel:1.1.1'
    androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.0') {
        exclude group: 'javax.inject'
    }
    compile files('libs/comscore.jar')
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-09-24 21:14:52

从您的依赖项"titleTextColor“属性中的一个错误来看,可能已经定义了它。

例如,这个广受欢迎的广场库有一张开放的票:

https://github.com/square/android-times-square/issues/226

因此,移除罪魁祸首库或如果您需要该库,您将需要恢复到API 22。

希望这能有所帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32769534

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档