android build error错误:在<declare-styleable> FontFamilyFont中,无法找到属性android:fontVariationSettings

时间:2018-03-09 04:02:34

标签: android gradle build.gradle

当我构建我的android项目时,我遇到以下错误

Error:In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings

在我能够很好地构建项目之前,我还没有修改任何配置,以下是我的相关配置

项目build.gradle

buildscript {
repositories {
    mavenCentral()
    jcenter{
        url 'http://jcenter.bintray.com/'
    }
    google()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
    classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1'
    classpath 'me.tatarka:gradle-retrolambda:3.2.4'
}
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        maven { url "https://jitpack.io" }
        maven{ url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2' }
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

app build.gradle

android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
    applicationId "com.bsyx.callsystem"
    minSdkVersion 19
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:support-v4:27.1.0'

compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:design:27.1.0'
compile 'com.android.support:recyclerview-v7:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
}

以下是错误详情

enter image description here

1 个答案:

答案 0 :(得分:0)

将“com.android.support:support-v4:27.1.0”更改为

configurations.all {
resolutionStrategy {
    force 'com.android.support:support-v4:27.1.0'
}}