How to deal with Error: failed linking references

How to deal with Error: failed linking references

今天我收到了关于 google api 更改的电子邮件,所以我开始更改内容,结果陷入了困境。 由于这些更改是新的,所以我添加了这个问题。我已经尝试了所有方法,比如检查资源名称,发现任何拼写错误,@id 更改为 @+id

正在尝试做一些事情。

这是构建项目后遇到的唯一错误。 反引号错误是 link 我可以降落的地方,但我无能为力。 (无法编辑。)

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: 错误:找不到资源 android:attr/fontVariationSettings。 C:\Users\Varun\Documents\Projects\Android\Work\androidApp\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2504: 错误:找不到资源 android:attr/ttcIndex。 错误:link引用失败。

Command: C:\Users\Varun\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar4967590956c301bbc7211def0c51bd\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(应用级别)

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'

新错误 即使在添加了对 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.03f8378feba44df7ba7cd9272d01837dad62b36\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`.

您必须将 compileSdkVersion 版本更改为 28 和 sync。 Android Studio 将要求下载必要的文件。

此外,如果您迁移到 androidX 包结构会更好,因为您将使用 sdk 版本 28。为此请转到:Android Studio> Refactor[in顶部面板]> 迁移到 AndroidX

Don't forget to backup your project before migration.