Eugen Martynov
Eugen Martynov

Reputation: 20130

Issue with build after updating Android SDK

I updated SDK yesterday and after project sync I got next message:

Error:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (23.2.0) and test app (23.1.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

I suppose Android Studio tries to use latest dependencies even I didn't change my Gradle files. How to workaround it?

Upvotes: 0

Views: 628

Answers (2)

Eugen Martynov
Eugen Martynov

Reputation: 20130

The cause is the dependency that we use. This library defines transitive dependency like:

<dependency>
      <groupId>com.android.support</groupId>
      <artifactId>appcompat-v7</artifactId>
      <version>23+</version>
      <scope>compile</scope>
</dependency>

So the solution was to exclude support library from it:

compile(<my dependency>, ext: 'aar') {
        exclude group: 'com.android.support'
        transitive = true
}

The owner of the library already notified about it.

Thank you for help!

Upvotes: 0

Devendra Dagur
Devendra Dagur

Reputation: 850

Add the below line in to your build.gradle script.

androidTestCompile 'com.android.support:support-annotations:23.2.0'

Upvotes: 1

Related Questions