kvaruna
kvaruna

Reputation: 387

How to deal with Error: failed linking references

Today i got email for google api changes so i started changing things and i got into this mess. As these changes are new am adding this question. I have tried all the ways like checking resources names, finding any misspell, @id is changed to @+id etc.

Things am trying to do.

This is the only error am getting after building project. The backquoted error is link where i can land but there is nothing i can do there. (Unable to edit.)

Android resource linking failed Output:   

C:\Users\Varun\Documents\Projects\Android\Work\androidApp\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:19: error: resource android:attr/dialogCornerRadius not found.

C:\Users\Varun\Documents\Projects\Android\Work\androidApp\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:23: error: resource android:attr/dialogCornerRadius not found.

C:\Users\Varun\Documents\Projects\Android\Work\androidApp\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2503: error: resource android:attr/fontVariationSettings not found. C:\Users\Varun\Documents\Projects\Android\Work\androidApp\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2504: error: resource android:attr/ttcIndex not found. error: failed linking references.

Command: C:\Users\Varun\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\044967590956c301bbc7211def0c51bd\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
        C:\Users\Varun\AppData\Local\Android\Sdk\platforms\android-27\android.jar\
        --manifest\
        C:\Users\Varun\Documents\Projects\Android\Work\androidApp\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
        -o\
        C:\Users\Varun\Documents\Projects\Android\Work\androidApp\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
        -R\
        @C:\Users\Varun\Documents\Projects\Android\Work\androidApp\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        C:\Users\Varun\Documents\Projects\Android\Work\androidApp\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
        --proguard-main-dex\
        C:\Users\Varun\Documents\Projects\Android\Work\androidApp\app\build\intermediates\legacy_multidex_aapt_derived_proguard_rules\debug\processDebugResources\manifest_keep.txt\
        --custom-package\
        com.seatmate.android\
        -0\
        apk\
        --preferred-density\
        xxhdpi\
        --output-text-symbols\
        C:\Users\Varun\Documents\Projects\Android\Work\androidApp\app\build\intermediates\symbols\debug\R.txt\
        --no-version-vectors Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0 

build.gradle (app level)

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
   lintOptions {
        checkReleaseBuilds false
    }

    compileSdkVersion 27
    defaultConfig {
        applicationId "com.seatmate.android"
        minSdkVersion 17
        targetSdkVersion 27
        versionCode 41
        versionName "1.0.40"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        signingConfig signingConfigs.config
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
        debug {
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

            debuggable true
        }
    }

    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
    productFlavors {

    }

    dexOptions {
        javaMaxHeapSize "4g"
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
    androidTestImplementation 'com.android.support:support-annotations:28.0.0'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    implementation project(':linkedin-sdk')

    //TODO: NEW DEPENDENCIES STARTS FROM HERE

    //Butterknife
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

    //Recycler View
    implementation 'com.android.support:recyclerview-v7:27.1.1'

    //CardView
    implementation 'com.android.support:cardview-v7:27.1.1'

    //GridLayout
    implementation 'com.android.support:gridlayout-v7:27.1.1'

    //Circular Image View
    implementation 'de.hdodenhof:circleimageview:2.2.0'

    //TextDrawable
    implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'

    //Expandable TextViewd
    implementation 'at.blogc:expandabletextview:1.0.5'

    //Analytics UI
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
    implementation 'devlight.io:arcprogressstackview:1.0.4'

    //Infinite Scroll
    implementation 'com.github.pwittchen:infinitescroll:0.0.1'

    //Spinners
    implementation 'com.github.ybq:Android-SpinKit:1.1.0'

    //Curved Drawer
    implementation 'com.rom4ek:arcnavigationview:1.0.3'

    //forBottom Tab Layout
    implementation 'com.github.nanjingboy:IconTabLayout:1.0.0'

    //bottom navigation bar
    implementation 'devlight.io:navigationtabbar:1.2.5'

    //Toolbar Search
    implementation 'com.miguelcatalan:materialsearchview:1.4.0'

    //Coordinator layout with tablayout
    implementation 'cn.hugeterry.coordinatortablayout:coordinatortablayout:1.2.2'

    //Smart Tab Layout
    implementation 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
    implementation 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'

    //Shimmer Effect
    implementation 'io.supercharge:shimmerlayout:2.1.0'

    implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'

    //For Glide
    implementation('com.github.bumptech.glide:glide:4.7.1@aar') {
        transitive = true
    }
    implementation 'com.github.florent37:glidepalette:2.1.2'
    implementation('com.github.bumptech.glide:recyclerview-integration:4.7.1') {
        transitive = false
    }
    implementation 'com.github.bumptech.glide:okhttp3-integration:4.7.1'

    //Glide pic loading
    annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
    implementation 'com.jaeger.statusbarutil:library:1.5.0'

    // implementation 'jp.wasabeef:glide-transformations:3.0.1'

    // Retrofit & OkHttp
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'

    //Logging Interceptor
    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'

    //RxJava
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.13'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'

    //Firebase
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.firebase:firebase-database:16.0.5'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'

    //FireBase Support Prior Android 5.0
    implementation 'com.android.support:multidex:1.0.3'

    //Bottom Sheet
    implementation 'com.cocosw:bottomsheet:1.3.1@aar'

    //Status Bar Color
    implementation('com.github.niorgai:StatusBarCompat:2.1.4', {
        exclude group: 'com.android.support'
    })

    //Animations
    implementation 'com.github.2359media:EasyAndroidAnimations:0.8'

    //Snackbar
    implementation 'com.androidadvance:topsnackbar:1.1.1'

    //    implementation 'org.aviran.cookiebar2:cookiebar2:1.0.9'

    //implementation 'com.abby.app:tsnackbar:1.0.7'

    //Google Places API
//    implementation 'com.google.android.gms:play-services-places:15.0.1'
    implementation 'com.facebook.android:facebook-android-sdk:4.40.0'
    implementation 'com.google.android.libraries.places:places:1.0.0'

    //SnackBar Small Size

    //    implementation('de.keyboardsurfer.android.widget:crouton:1.8.5@aar') {

    //        // exclusion is not necessary, but generally a good idea.

    //        exclude group: 'com.google.android', module: 'support-v4'

    //    }

    //For Image Croping

    //    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'

    //For Fab
    implementation 'com.github.clans:fab:1.6.4'
    implementation 'com.leinardi.android:speed-dial:1.0.2'

    //Sweet Aleart
    implementation 'cn.pedant.sweetalert:library:1.3'

    //StatusBar Color
    implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'

    //Pop up for relations
    implementation 'com.shehabic.droppy:Droppy:0.6.0@aar'

    //For Alignment of skills as grid
    implementation 'com.google.android:flexbox:1.0.0'

    //Wizard for Organization Registration
    implementation 'com.redbooth:WelcomeCoordinator:1.0.1'

    //For stepper view
    implementation 'com.kofigyan.stateprogressbar:stateprogressbar:1.0.0'

    //Instabug
    implementation 'com.instabug.library:instabug:8.0.14'

    //BlurViews
    implementation 'jp.wasabeef:blurry:2.1.1'

    //Animation
    implementation 'com.android.support:support-dynamic-animation:27.1.1'

    // Google Api Client library and Android extension
    implementation 'com.google.apis:google-api-services-people:v1-rev139-1.22.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.api-client:google-api-client:1.22.0'
    implementation 'com.google.api-client:google-api-client-android:1.22.0'

    //Tap Target View for guidelines
    implementation 'com.getkeepsafe.taptargetview:taptargetview:1.12.0'
    implementation 'uk.co.samuelwall:material-tap-target-prompt:2.13.0'

    //Facebook Share
//    implementation 'com.facebook.android:facebook-share:[4,5)'

    //To check memory Leaks in app
//    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
//    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
//    // Optional, if you use support library fragments:
//    debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.2'

}

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

New Errors Even after adding dependency for Guava

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\Varun\.gradle\caches\modules-2\files-2.1\com.google.guava\guava-jdk5\17.0\463f8378feba44df7ba7cd9272d01837dad62b36\guava-jdk5-17.0.jar

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.


Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete

Caused by: com.android.tools.r8.utils.AbortException: Error: Type com.google.common.util.concurrent.Futures$FutureCombiner is referenced as an interface from `com.google.common.util.concurrent.Futures$7`.

Upvotes: 1

Views: 13853

Answers (1)

ankuranurag2
ankuranurag2

Reputation: 2441

You will have to change your compileSdkVersion version to 28 and sync. Android Studio will ask to download the necessary files.

Also it would be better if you migrate to androidX package structure as you would be using sdk version 28. For that go to: Android Studio> Refactor[in top panel]> Migrate to AndroidX

Don't forget to backup your project before migration.

Upvotes: 6

Related Questions