0

I'm getting an error message saying "Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.". Searching Stackoverflow, I see this often happens when the SDK version doesn't match the Support Library version. However, as far as I can tell, I am running version 23 all around. Here is my gradle code:

android { compileSdkVersion 23 buildToolsVersion '23.0.2'

defaultConfig {
    applicationId "xxxxxxxxx"
    minSdkVersion 23
    targetSdkVersion 23
    versionCode 15
    versionName "2.1"
}

...and...

dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile('org.apache.httpcomponents:httpmime:4.3.1') {
    exclude module: "httpclient"
}
compile('org.apache.httpcomponents:httpcore:4.3.1') {
    exclude module: "httpclient"
}
compile 'com.facebook.android:facebook-android-sdk:[4,5)'

}

So to my eyes, it looks like my program is using SDK 23 everywhere. And that's what I want. And yet it doesn't work. So this is a diagnostic question. How can I find out exactly how and where it is resolving these dependencies? There must be a place where it is getting crossed up. I just need to trace where that is happening.

  • Use latest stable build tools, currently 25.0.3. Always prefer the newest build tools, this doesn't have to match compile SDK version. ***///*** Switch to Google Play services SDK version 9.8.0. Play services SDK 8.x is intended for/depends on support libs 22.x so there may be issue coming from this. – Eugen Pechanec Jun 01 '17 at 14:25
  • Thanks. The code compiled cleanly as recently as last weekend. So I'm trying to avoid changing any code unless I have to. As for the question of diagnostics, A.Edwar's post was perfect. I would mark it as the solution if it hadn't been deleted. I was able to get the following error message "rror:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (25.3.1) and test app (23.1.1) differ. " – user2625768 Jun 01 '17 at 20:31
  • This means the app is trying to load version 25.3.1 even though I explicitly specified 23.1.1. I don't yet know *why* but at least I see the issue. Thanks A.Edwar! – user2625768 Jun 01 '17 at 20:39
  • See https://stackoverflow.com/questions/42949974/android-support-repo-46-0-0-with-android-studio-2-3/42957234#42957234 as to why. You didn't actually specify it *explicitly*. That would be `compile 'com.android.support:design:[23.1.1]'`, note the brackets. And I'm not even sure that would be enough. The answer provides a bulletproof method. – Eugen Pechanec Jun 01 '17 at 22:41

1 Answers1

0

The issue is resolved thanks to this link from A. Edwar: https://stackoverflow.com/a/35235229/7161261. Using the recommended diagnostic tools, I learned the app was trying to load a different version of the support library than specified in my code. Turns out the reason was that the Facebook plugin uses the newer version of the library and was somehow overriding me. Since I can't change the Facebook plugin, I could find no way around this except to try Eugen Pechanec's suggestion and change my code to use the newer SDK version. It now works. So thanks to both A. Edwar and Eugen Pechanec.