错误:配置''的资源'attr / fontFamily'的重复值

时间:2019-03-20 06:23:50

标签: java android

在构建项目时遇到此错误 Android资源编译失败

Android资源编译失败

  

E:\ Study \ Android \ Clients Projects \ Smupp \ Smupp   1.2.1 \ Smupp \ app \ build \ intermediates \ incremental \ mergeDebugResources \ merged.dir \ values \ values.xml:5397:   错误:资源'attr / fontFamily'与配置''重复的值。   E:\ Study \ Android \ Clients Projects \ Smupp \ Smupp   1.2.1 \ Smupp \ app \ build \ intermediates \ incremental \ mergeDebugResources \ merged.dir \ values \ values.xml:5397:   错误:先前在此处定义的资源。

尝试了所有先前提出的类似问题,但没有帮助。我被停职了4天。

build.gradle(app)
buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.28.0'
    }
}

import java.text.SimpleDateFormat

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

apply plugin: 'com.google.gms.google-services'

android {
    dexOptions {
        jumboMode true
    }
    def versionMajor = 1 // 1 - 20000
    def versionMinor = 2 // 0 - 9
    def versionPatch = 1 // 0 - 99
    def buildNumber = 0 // 0 - 999 used for testing builds, excluded from release versionName
    def appName = "Smupp"
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.smupp"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1201001
        versionName "1.2.2"
        renderscriptTargetApi 19
        renderscriptSupportModeEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        //android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
        resConfigs "en"
        /*javaCompileOptions {
            annotationProcessorOptions {
                includeCompileClasspath false
            }
        }*/
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildTypes {
        release {
            minifyEnabled false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        abortOnError false
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }

    buildToolsVersion '28.0.3'
}

dependencies {
    def supportLibVersion = '1.0.0-beta01'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    implementation "androidx.appcompat:appcompat:1.0.2"
    implementation "androidx.legacy:legacy-support-v4:1.0.0"
    implementation "androidx.cardview:cardview:1.0.0"
    implementation "com.google.android.material:material:1.1.0-alpha04"
    implementation "androidx.recyclerview:recyclerview:1.1.0-alpha03"
    implementation "androidx.percentlayout:percentlayout:1.0.0"
    implementation 'com.google.android.material:material:1.0.0'

    implementation 'com.google.firebase:firebase-messaging:17.4.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    //implementation "com.google.android.gms:play-services-gcm:16.1.0"

    testImplementation 'junit:junit:4.12'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.squareup.okhttp:okhttp:2.7.5'
    implementation 'com.jakewharton:butterknife:10.1.0'
    implementation 'com.github.johnkil.android-robototextview:robototextview:2.4.3'
    implementation 'com.squareup.retrofit:retrofit:1.9.0'
    implementation 'com.facebook.android:facebook-android-sdk:4.40.0'
    implementation 'com.google.android.exoplayer:exoplayer:r1.5.8'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.googlecode.mp4parser:isoparser:1.1.20'
    implementation('com.twitter.sdk.android:twitter:2.2.0@aar') {
        transitive = true;
    }
}

1 个答案:

答案 0 :(得分:1)

看到

  

values \ values.xml:5397:错误:先前在此处定义的资源。

尝试从fontFamily重命名values.xml的名称。