【问题标题】:When trying to build, receiving this error message "error: resource android:attr/fontVariationSettings not found."尝试构建时,收到此错误消息“错误:找不到资源 android:attr/fontVariationSettings。”
【发布时间】:2018-10-29 21:46:14
【问题描述】:

以下是我的 gradle 文件:

apply plugin: "com.android.application"

android {
    compileSdkVersion 27
    defaultConfig {
    applicationid "com.thiswasleftoutintentionally"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }

    packagingOptions {
        exclude "META-INF/DEPENDENCIES"
        exclude "META-INF/LICENSE"
        exclude "META-INF/NOTICE"
        exclude "META-INF/ASL2.0"
        exclude "LICENSE.txt"
        exclude "Readme.md"
        exclude ".gitignore"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    def lifecycle_version = "1.1.1"
    def support_library_version = "27.1.1"
    def gms_library_version = "15.0.1"
    def room_version = "1.1.1-rc1"
    def roomx_version = "2.0.0-alpha1"
    def work_version = "1.0.0-alpha01"
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:support-v4:$support_library_version"
    implementation "com.android.support:appcompat-v7:$support_library_version"
    implementation "com.android.support:support-compat:$support_library_version"
    implementation "com.android.support:support-core-utils:$support_library_version"
    implementation "com.android.support:support-core-ui:$support_library_version"
    implementation "com.android.support:support-fragment:$support_library_version"
    implementation "com.android.support:recyclerview-v7:$support_library_version"
    implementation "com.android.support.constraint:constraint-layout:1.1.0"
    implementation "com.android.support:design:$support_library_version"
    implementation "com.android.support:support-vector-drawable:$support_library_version"

    testImplementation "junit:junit:4.12"
    androidTestImplementation "com.android.support.test:runner:1.0.2"
    androidTestImplementation "com.android.support.test.espresso:espresso-core:3.0.2"

    implementation "com.google.code.gson:gson:2.8.2"

    implementation "com.google.maps.android:android-maps-utils:0.5"

    implementation "com.google.android.gms:play-services-base:$gms_library_version"
    implementation "com.google.android.gms:play-services-maps:$gms_library_version"
    implementation "com.google.android.gms:play-services-location:$gms_library_version"

    implementation "com.google.android.gms:play-services-safetynet:$gms_library_version"

    implementation "com.google.firebase:firebase-core:15.0.2"
    implementation "com.google.firebase:firebase-messaging:15.0.2"
    implementation "com.google.firebase:firebase-invites:15.0.1"
    implementation "com.google.firebase:firebase-ads:15.0.1"
    implementation "com.google.firebase:firebase-perf:15.2.0"

    implementation "com.crashlytics.sdk.android:crashlytics:2.9.2"

    implementation "com.firebase:firebase-jobdispatcher:0.8.5"

    // Room (use 1.1.0-alpha1 for latest alpha)
    implementation "android.arch.persistence.room:runtime:$room_version"
    annotationProcessor "android.arch.persistence.room:compiler:$room_version"

    // Test helpers for Room
    testImplementation "android.arch.persistence.room:testing:$room_version"

    implementation "androidx.room:room-runtime:$roomx_version"
    annotationProcessor "androidx.room:room-compiler:$roomx_version"

    // Test helpers
    testImplementation "androidx.room:room-testing:$roomx_version"

    // ViewModel and LiveData
    implementation "android.arch.lifecycle:extensions:$lifecycle_version"

    //annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
    annotationProcessor "android.arch.lifecycle:common-java8:1.1.1"

    // Test helpers for LiveData
    testImplementation "android.arch.core:core-testing:$lifecycle_version"

    // Test helpers for Room
    testImplementation "android.arch.persistence.room:testing:1.1.0"

    // ViewModel and LiveData
    //TODO uncomment
    //implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"

    //TODO uncomment
    //implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"

    implementation "android.arch.work:work-runtime:$work_version"
    // optional - Test helpers
    androidTestImplementation "android.arch.work:work-testing:$work_version"

    implementation "com.squareup.okhttp3:okhttp:3.9.1"
    implementation "de.hdodenhof:circleimageview:2.2.0"
}

/* Add the Fabric plugin: */
apply plugin: "io.fabric"

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

在我添加 WorkManager 和 androidx 扩展之前,它一直在工作。一些生命周期扩展的东西不起作用,所以我注释掉希望以后发布。

我不确定 appcompat-v7 库中的值如何与我编写的内容相关联。

有谁知道出了什么问题?

【问题讨论】:

    标签: android android-layout android-library


    【解决方案1】:

    如果您将以下内容注释掉,它会再次构建。

    implementation "androidx.room:room-runtime:$roomx_version"
    annotationProcessor "androidx.room:room-compiler:$roomx_version"
    
    // Test helpers
    testImplementation "androidx.room:room-testing:$roomx_version"
    

    【讨论】:

      猜你喜欢
      • 2018-08-18
      • 2019-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-28
      • 2021-12-11
      • 2019-12-02
      相关资源
      最近更新 更多