Android Studio failed linking references

Anirudh Vashisht picture Anirudh Vashisht · Jul 22, 2019 · Viewed 21.7k times · Source

I am getting the following error in my Android Studio. This is after the recent update I did. My Android Studio version is 3.4, Gradle version is 5.5.1, plugin version is 3.4.2

Here is the error:

Android resource linking failed

warn: removing resource com.anirudh.gighub:string/com_facebook_loginview_logged_in_using_facebook_f1gender without required default value.
  F:\gigHub\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1437: error: resource dimen/smallTxtSize (aka com.anirudh.gighub:dimen/smallTxtSize) not found.
  F:\gigHub\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1438: error: resource drawable/facebook_signin_btn (aka com.anirudh.gighub:drawable/facebook_signin_btn) not found.
  error: failed linking references.****

Here is the `build.gradle

//noinspection GradleCompatible
apply plugin: 'com.android.application'
android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.anirudh.gighub"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    testImplementation 'junit:junit:4.13-beta-3'
    implementation 'com.google.firebase:firebase-auth:18.1.0'
    implementation 'com.facebook.android:facebook-login:5.0.1'
    implementation 'com.github.ybq:Android-SpinKit:1.2.0'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation ` enter code here `
    'com.android.support.test.espresso:espresso-core:3.0.2'
}

Answer

Farouq Afghani picture Farouq Afghani · Jul 22, 2019

Try this

1) File -> Invalidate Caches / Restart

2) Delete the build file under app (F:\gigHub\app\build)

3) Clean Project

4) Rebuild Project