11

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'
}
Zain Aftab
  • 703
  • 7
  • 21
Anirudh Vashisht
  • 129
  • 1
  • 1
  • 5
  • Guys all the trouble was the android version i was using. One of those hickups in your coding life. Creating a new project and copying all the code to that made all the difference. Cheere! ;) – Anirudh Vashisht Jul 25 '19 at 19:41

6 Answers6

9

Try this

1) File -> Invalidate Caches / Restart

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

3) Clean Project

4) Rebuild Project

Farouq Afghani
  • 296
  • 1
  • 6
1

1) Check Your "dimen.xml" file and add that line (if file not found create that)

<dimen name="smallTxtSize">14sp</dimen>

2) Check your "drawable" folder "facebook_signin_btn" file was found or not? (if file not found create that)

0

Please try below in Android Studio:-

File -> Invalidate Caches / Restart

Shalu T D
  • 3,921
  • 2
  • 26
  • 37
0

Use the latest appcompat library. After changing to:

implementation 'com.android.support:appcompat-v7:28.0.0' 

everything worked great.

arniotaki
  • 2,175
  • 2
  • 23
  • 26
0

my problem was that when i used refactor to change one of my variables in class named "rating", it changed all the android:rating attributes to android:rate and that caused this problem. for those who have this problem, check gradle build error exactly for more information. maybe that's because of your undefined xml attributes.

Hossein Karami
  • 776
  • 10
  • 11
0

Use this as your current build. The compileSdkVersion needs to be the same as targetSdkVersion

android {
    compileSdkVersion 30
    defaultConfig {
        applicationId "com.example.app"
        minSdkVersion 24
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
}
thexiv
  • 27
  • 9