0
votes

Something behind the scenes happened and my project will no longer build and/or run because of a conflict in the dependency stack.

I have tried to tinker with the version numbers of the dependencies and can confirm that the facebookSDK project is set to build with support lib v22. How can I figure out what is causing the v23 appcompat support lib to get pulled into my project?

Here's the build error I am getting:

/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/res/values-v23/values-v23.xml Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

And the gradle info:

android {
  compileSdkVersion 22
  buildToolsVersion "22.0.1"
  defaultConfig {
    ...
    minSdkVersion 15
    targetSdkVersion 22

    multiDexEnabled true
  }
}

dependencies {
  compile project(':facebookSDK')
  compile 'com.android.support:support-v4:22.0.0'
  compile 'com.android.support:appcompat-v7:22.2.1'
  compile 'com.google.android.gms:play-services:8.4.0'
  compile 'com.android.support:design:22.2.1'
  compile 'com.android.support:cardview-v7:22.2.1'
  compile 'com.android.support:multidex:1.0.0'
...
}
2

2 Answers

2
votes

Facebook with its facebook-android-sdk tries to keep their dependencies as latest as possible. You had an issue with 23.0.0Android support libraries version, I with 23.1.1...:-)

I highly recommend to change your existing configuration to this one:

android {
  compileSdkVersion 24
  buildToolsVersion "24.0.1"
  defaultConfig {
    ...
    minSdkVersion 15
    targetSdkVersion 22

    multiDexEnabled true
  }
}

dependencies {
  compile 'com.android.support:support-v4:24.1.1'
  compile 'com.android.support:appcompat-v7:24.1.1'
  compile 'com.google.android.gms:play-services:8.4.0'
  compile 'com.android.support:design:24.1.1'
  compile 'com.android.support:cardview-v7:24.1.1'
  compile 'com.android.support:multidex:1.0.0'
...
  compile 'com.facebook.android:facebook-android-sdk:4.+'
}

Look, you can even add facebook-android-sdk as Gradle's dependencies, so you can delete existin folder and don't bother about stay fresh with it.

You can also stay with your a bit low targetSdkVersion, which is good when you don't want to implement things like Android permissions or Doze mode compability.

Hope it will help

1
votes

You can update these lines to the latest versions without affecting which API level you can run the code at. You are missing the v23 resources, so compile with at least version 23.

compileSdkVersion 22
buildToolsVersion "22.0.1"

These lines should be the same version, but they aren't even needed when you use the support:design library. Feel free to delete these.

compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:appcompat-v7:22.2.1'

For this line, I highly doubt that you are using all of the Google play services. Please read about only using those you really need in your app.

compile 'com.google.android.gms:play-services:8.4.0'

After you narrowed down those possibilities, I'd suggest you use these (from experience, seems to work fine).

compile 'com.android.support:design:23+'
compile 'com.android.support:cardview-v7:23+'

Since you haven't shown the Facebook dependencies, it's hard to give advice about that