gradle Android Studio更新后链接引用失败 [英] failed linking references after update of gradle Android Studio

查看:353
本文介绍了gradle Android Studio更新后链接引用失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新Gradle之后,我得到了这个错误(我在更新Gradle的同时还添加了maven {jitpack.io}和geofirestore依赖项):

I got this error after update my Gradle (I have also added maven{jitpack.io} and geofirestore dependencies at the same of updating Gradle) :

Android resource linking failed
Output:  C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1169: error: resource android:attr/fontVariationSettings not found.
C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1170: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Command: C:\Users\Paul\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\74062dcec80f00402d5904d26f22db6e\aapt2-3.2.0-4818971-windows\aapt2.exe link -I\
        C:\Users\Paul\AppData\Local\Android\Sdk\platforms\android-27\android.jar\
        --manifest\
        C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
        -o\
        C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
        -R\
        @C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
        --custom-package\
        com.how2ride.how2ride\
        -0\
        apk\
        -c\
        en,fr\
        --output-text-symbols\
        C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\symbols\debug\R.txt\
        --no-version-vectors
Daemon:  AAPT2 aapt2-3.2.0-4818971-windows Daemon #0

我该如何解决?

这是我的Project构建包:

Here my Project build gradle:

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.0.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()

        maven { url 'https://jitpack.io' }
    }
}

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

和我的模块构建gradle:

and my Module build gradle:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.how2ride.how2ride"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        resConfigs "en", "fr"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation "com.google.android.gms:play-services-location:15.0.1"
    implementation 'com.google.firebase:firebase-ads:15.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.3'
    implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
    implementation 'com.google.firebase:firebase-auth:16.0.3'
    implementation 'com.google.firebase:firebase-firestore:17.1.0'
    implementation 'com.github.imperiumlabs:GeoFirestore-Android:v1.1.1'
    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'
}

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

我使用的是最新版本的android studio,并且在升级gradle之前,我的项目运行正常.

I have the last version of android studio and my project worked perfectly before upgrading my gradle...

推荐答案

将compileSdkVersion更改为:

Change the compileSdkVersion to:

compileSdkVersion 28

这些属性已在此版本中添加.在此处此处

These attributes were added in this version. Check here, here and here

这篇关于gradle Android Studio更新后链接引用失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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