Conflict with dependency

52 views
Skip to first unread message

Tomáš Procházka

unread,
Sep 8, 2017, 5:08:10 PM9/8/17
to adt-dev
I have question about this error:

Error:Execution failed for task ':app:preDefaultDebugAndroidTestBuild'.
> Conflict with dependency 'com.facebook.android:facebook-android-sdk' in project ':app'. Resolved versions for app (4.23.0) and test app (4.22.0) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

I always fix it by copy the same dependency with testCompile or androidTestCompile. To force the same version everywhere.

But I don't understand how this can happen. I thought that test and androidTest always use the same dependencies as the main project. I can only add some additional test only dependencies by testCompile or androidTestCompile. So I think that until I add some newer version explicitly as testCompile it can't happen. But I have facebook-android-sdk defined only in the app module and it is defined also in some 3rd party libraries, but nowhere as testCompile.

And on 3.0.0 plugin it looks that it is much worse. It looks like problem happens here every time when you have two 3rd libs which booth use a different version of same common dependency.

Tomáš Procházka

unread,
Sep 8, 2017, 6:15:39 PM9/8/17
to adt-dev
It's very weird, with build plugin 3.0.0-beta4 almost all dependencies must be repeated in the "androidTest" variant.
If I check dependnecies tries the dependenci in app module looks like this

+--- com.flurry.android:analytics:6.3.1 -> 6.6.0

and in the appTest module always just like this (the same dependency, the "->" is always missing for all the dependencies in the dependency tree)

+--- com.flurry.android:analytics:6.3.1

So it looks that in the androidTest dependencies doesn't work the latest version resolving mechanism like normally should work.

Tomáš Procházka

unread,
Sep 11, 2017, 7:30:26 AM9/11/17
to adt-dev

Tomáš Procházka

unread,
Oct 17, 2017, 6:52:56 AM10/17/17
to adt-dev
It is solved in RC1. Thanks!

Dne pondělí 11. září 2017 13:30:26 UTC+2 Tomáš Procházka napsal(a):
Reply all
Reply to author
Forward
0 new messages