0

Yesterday, my app was successfully compiling. Today, I get a lot of errors and can't fix.

Here, some friends said that, "already answered" the suggested solution is using exact same version on gradle, but in my graddle, they are already same?

****my graddle****

 compileSdkVersion 26
    minSdkVersion 17
    targetSdkVersion 26
    buildToolsVersion '27.0.3'*

dependencies are in picture for example I have implemented exifinterface:26.0.1 but still it is warning me that i am using exifinterface:27.0.1

enter image description here

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
yucel
  • 365
  • 4
  • 11
  • Possible duplicate of [All com.android.support libraries must use the exact same version specification](https://stackoverflow.com/questions/42374151/all-com-android-support-libraries-must-use-the-exact-same-version-specification) – Jacob Celestine Aug 09 '18 at 11:06
  • If you check the picture, you can see, they are allready in same version. 26.0.1 – yucel Aug 09 '18 at 11:07
  • It doesn't work like that, the other dependencies you have added could be accessing another version in their files, which in turn would lead to this error you are facing. To fix this, you have to type some command(I forgot what it was, try searching for it) and check the versions each dependency is using and make everything to use the same one. – Jacob Celestine Aug 09 '18 at 11:10
  • I already did it, I have found the dependency tree in gradle. Than I ve added exifinterface:26.0.1 but in gradle still giving error that you are using 27.0.1 – yucel Aug 09 '18 at 11:19
  • You might have missed some. I mean a dependency using another dependency might be using another version. It's hard to get them all. Try the answer I just posted. – Jacob Celestine Aug 09 '18 at 11:23

2 Answers2

1

Ever since I added this code to my gradle file I haven't encountered this problem, try:

// use default version for all support repositories
configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion 'PUT_THE_VERSION_YOU_WANT' //26.0.1
            }
        }
    }
}

You might have to add multiDexEnabled true insinde android.

Jacob Celestine
  • 1,758
  • 13
  • 23
0

try after removing

buildToolsVersion '27.0.3'*

Diwakar Singh
  • 267
  • 3
  • 12