Firebase-android-sdk: firebase-common: version conflict with auto-value-annotations

Created on 27 Mar 2019  路  8Comments  路  Source: firebase/firebase-android-sdk

  • Android Studio version: 3.5 Canary 7
  • Firebase Component: Common
  • Component version: 16.1.0

Steps to reproduce:

The firebase-common dependency exposes auto-value-annotations via its api configuration. This leads to build failures when the consuming project includes a dependency on a different version of auto-value-annotations.

For example:

* What went wrong:
Could not determine the dependencies of task ':Mobile-Android:preDevDebugBuild'.
> Could not resolve all task dependencies for configuration ':Mobile-Android:devDebugCompileClasspath'.
   > Could not resolve com.google.auto.value:auto-value-annotations:1.6.3.
     Required by:
         project :Mobile-Android
      > Cannot find a version of 'com.google.auto.value:auto-value-annotations' that satisfies the version constraints: 
           Dependency path ':Mobile-Android:unspecified' --> 'com.google.auto.value:auto-value-annotations:1.6.3'
           Constraint path ':Mobile-Android:unspecified' --> 'com.google.auto.value:auto-value-annotations:{strictly 1.6}' because of the following reason: devDebugRuntimeClasspath uses version 1.6
           Dependency path ':Mobile-Android:unspecified' --> 'com.google.firebase:firebase-messaging:17.5.0' --> 'com.google.firebase:firebase-common:16.1.0' --> 'com.google.auto.value:auto-value-annotations:1.6'

   > Could not resolve com.google.auto.value:auto-value-annotations:{strictly 1.6}.
     Required by:
         project :Mobile-Android
      > Cannot find a version of 'com.google.auto.value:auto-value-annotations' that satisfies the version constraints: 
           Dependency path ':Mobile-Android:unspecified' --> 'com.google.auto.value:auto-value-annotations:1.6.3'
           Constraint path ':Mobile-Android:unspecified' --> 'com.google.auto.value:auto-value-annotations:{strictly 1.6}' because of the following reason: devDebugRuntimeClasspath uses version 1.6
           Dependency path ':Mobile-Android:unspecified' --> 'com.google.firebase:firebase-messaging:17.5.0' --> 'com.google.firebase:firebase-common:16.1.0' --> 'com.google.auto.value:auto-value-annotations:1.6'

   > Could not resolve com.google.auto.value:auto-value-annotations:1.6.
     Required by:
         project :Mobile-Android > com.google.firebase:firebase-common:16.1.0
      > Cannot find a version of 'com.google.auto.value:auto-value-annotations' that satisfies the version constraints: 
           Dependency path ':Mobile-Android:unspecified' --> 'com.google.auto.value:auto-value-annotations:1.6.3'
           Constraint path ':Mobile-Android:unspecified' --> 'com.google.auto.value:auto-value-annotations:{strictly 1.6}' because of the following reason: devDebugRuntimeClasspath uses version 1.6
           Dependency path ':Mobile-Android:unspecified' --> 'com.google.firebase:firebase-messaging:17.5.0' --> 'com.google.firebase:firebase-common:16.1.0' --> 'com.google.auto.value:auto-value-annotations:1.6'
core

Most helpful comment

As a hotfix you can force the dependency:

allprojects {
  configurations.all {
    resolutionStrategy {
      force("com.google.auto.value:auto-value-annotations:1.6.3")
    }
  }
}

All 8 comments

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

As a hotfix you can force the dependency:

allprojects {
  configurations.all {
    resolutionStrategy {
      force("com.google.auto.value:auto-value-annotations:1.6.3")
    }
  }
}

Yep, that's exactly what we're doing.

/assign @vkryachko

Note that another possible workaround (at least on my project) was to just start including my own auto-value-annotations as api as well.

As a hotfix you can force the dependency:

allprojects {
  configurations.all {
    resolutionStrategy {
      force("com.google.auto.value:auto-value-annotations:1.6.3")
    }
  }
}

hi i must to put this where?

As a hotfix you can force the dependency:

allprojects {
configurations.all {
resolutionStrategy {
force("com.google.auto.value:auto-value-annotations:1.6.3")
}
}
}

hi i must to put this where?

In _android/build.gradle_

As a hotfix you can force the dependency:

allprojects {
  configurations.all {
    resolutionStrategy {
      force("com.google.auto.value:auto-value-annotations:1.6.3")
    }
  }
}

it doesn't work fo me

Was this page helpful?
0 / 5 - 0 ratings