错误:属性“字体"已经用不兼容的格式定义 [英] Error : Attribute "font" already defined with incompatible format

查看:31
本文介绍了错误:属性“字体"已经用不兼容的格式定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在通过 Gradle 构建应用程序时遇到问题,如下所示.我得到了错误:错误:(516) 属性字体"已用不兼容的格式定义.错误:(298) 此处定义的原始属性.错误:(516) 属性字体"已用不兼容的格式定义.错误:(298) 此处定义了原始属性.

I has problem when build app via Gradle as below. And I got the error: Error:(516) Attribute "font" already defined with incompatible format. Error:(298) Original attribute defined here. Error:(516) Attribute "font" already defined with incompatible format. Error:(298) Original attribute defined here.

但我没有在我的模块中找到使用字体"属性的地方.

But I don't find places using "font" attr in my modules.

请帮我解决这个问题.

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.3-alpha', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile('com.weiwangcn.betterspinner:library-material:1.1.0') {
        exclude group: 'com.android.support', module: 'appcompat-v7'
        exclude group: 'com.rengwuxian.materialedittext', module: 'library'
    }
    compile('com.quickblox:quickblox-android-sdk-chat:2.6.1@aar') {
        transitive = true
    }
    compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
        transitive = true;
        compile 'com.stripe:stripe-android:+'
    }
    compile('com.crashlytics.sdk.android:answers:1.3.9@aar') {
        transitive = true;
    }
    compile 'com.quickblox:quickblox-android-sdk-core:2.6.1@aar'
    compile 'com.quickblox:quickblox-android-sdk-content:2.6.1@aar'
    compile 'com.quickblox:quickblox-android-sdk-messages:2.6.1@aar'

    compile 'com.android.support:appcompat-v7:26.0.1'
    compile 'com.android.support:design:26.0.1'
    compile 'com.android.support:cardview-v7:26.0.1'
    compile 'com.android.support:recyclerview-v7:26.0.1'
    compile 'com.android.support:leanback-v17:26.0.1'
    compile 'com.android.support:customtabs:26.0.1'
    compile 'com.rengwuxian.materialedittext:library:2.1.4'
    compile 'com.bignerdranch.android:expandablerecyclerview:2.1.1'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.daimajia.swipelayout:library:1.2.0'
    compile 'ayar.oktay.library:advancedtextview:0.4.5'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'jp.wasabeef:recyclerview-animators:2.2.4'
    compile 'com.crystal:crystalrangeseekbar:1.1.1'
    compile 'com.kyleduo.switchbutton:library:1.4.4'
    compile 'me.relex:circleindicator:1.2.1@aar'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'com.squareup.retrofit2:retrofit:2.2.0'
    compile 'com.squareup.retrofit2:converter-gson:2.2.0'
    compile 'com.squareup.okhttp3:okhttp:3.6.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.yalantis:ucrop:2.2.0'
    compile 'com.yalantis:ucrop:2.2.0-native'
    compile 'pub.devrel:easypermissions:0.1.9'
    compile 'com.google.firebase:firebase-messaging:11.0.4'
    compile 'com.google.android.gms:play-services-gcm:11.0.4'


    compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
    testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
    compile 'com.google.dagger:dagger:2.8'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.8'
    debugAnnotationProcessor 'com.google.dagger:dagger-compiler:2.8'
    compile 'io.reactivex:rxjava:1.2.2'
    compile 'io.reactivex:rxandroid:1.2.1'
    compile 'com.squareup.retrofit2:adapter-rxjava:2.2.0'
    compile 'com.squareup.retrofit2:converter-gson:2.2.0'
}
apply plugin: 'com.google.gms.google-services'

推荐答案

就我而言,问题出在定义属性 "app:font" 的库中.我删除了那个库和 xml 中所有写 "app:font" 的地方,我的问题就消失了.

In my case the problem was in a library that defined attribute "app:font". I removed that library and all the places in xml where were written "app:font" and my problem disappeared.

再举一个例子:如果您遇到错误 AAPT: Attribute "iconTint" already defined with incompatible format 那么您应该在 xml 中搜索并删除 "app:iconTint" 以解决此问题.

As an additional example: If you have got the error AAPT: Attribute "iconTint" already defined with incompatible format then you should search and delete "app:iconTint" in your xml to resolve this problem.

这篇关于错误:属性“字体"已经用不兼容的格式定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆