只要我将build.grade
文件更新为API级别23,我就会收到无法找到的错误,并且无法修复它们。但是,这些相同的错误不会显示为22或21.显示的错误是:
Attribute "titleTextColor" has already been defined
,由于某种原因,它会突出显示colors.xml
文件。我的整个项目中没有titleTextColor
的实例。当我进行项目范围(cmd + shift + f)搜索时,titleTextColor
的唯一实例会显示在生成的构建文件中。这里发生了什么,我该如何解决这个问题呢?
[编辑] build.grade
档案
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')
}
答案 0 :(得分:1)
从错误中看起来就像你的某个依赖关系" titleTextColor
"属性已经定义了。
例如,这个受欢迎的方形图书馆有一张开放票:
https://github.com/square/android-times-square/issues/226
因此,如果您需要库,请删除罪魁祸首库或包含在内,您需要恢复到API 22。
希望这有帮助。