Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

failed linking references after update of gradle Android Studio

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:UsersPaulAndroidStudioProjectsHow2Ride2appuildintermediatesincrementalmergeDebugResourcesmerged.dirvalues-v28values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
C:UsersPaulAndroidStudioProjectsHow2Ride2appuildintermediatesincrementalmergeDebugResourcesmerged.dirvalues-v28values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
C:UsersPaulAndroidStudioProjectsHow2Ride2appuildintermediatesincrementalmergeDebugResourcesmerged.dirvaluesvalues.xml:1169: error: resource android:attr/fontVariationSettings not found.
C:UsersPaulAndroidStudioProjectsHow2Ride2appuildintermediatesincrementalmergeDebugResourcesmerged.dirvaluesvalues.xml:1170: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Command: C:UsersPaul.gradlecachesransforms-1files-1.1aapt2-3.2.0-4818971-windows.jar74062dcec80f00402d5904d26f22db6eaapt2-3.2.0-4818971-windowsaapt2.exe link -I
        C:UsersPaulAppDataLocalAndroidSdkplatformsandroid-27android.jar
        --manifest
        C:UsersPaulAndroidStudioProjectsHow2Ride2appuildintermediatesmerged_manifestsdebugprocessDebugManifestmergedAndroidManifest.xml
        -o
        C:UsersPaulAndroidStudioProjectsHow2Ride2appuildintermediatesprocessed_resdebugprocessDebugResourcesout
esources-debug.ap_
        -R
        @C:UsersPaulAndroidStudioProjectsHow2Ride2appuildintermediatesincrementalprocessDebugResources
esources-list-for-resources-debug.ap_.txt
        --auto-add-overlay
        --java
        C:UsersPaulAndroidStudioProjectsHow2Ride2appuildgenerated
ot_namespaced_r_class_sourcesdebugprocessDebugResources

        --custom-package
        com.how2ride.how2ride
        -0
        apk
        -c
        en,fr
        --output-text-symbols
        C:UsersPaulAndroidStudioProjectsHow2Ride2appuildintermediatessymbolsdebugR.txt
        --no-version-vectors
Daemon:  AAPT2 aapt2-3.2.0-4818971-windows Daemon #0

How can I solve this?

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
}

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'

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

question from:https://stackoverflow.com/questions/52487402/failed-linking-references-after-update-of-gradle-android-studio

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Change the compileSdkVersion to:

compileSdkVersion 28

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...