When updating Android studio to the new version 3.1.1
, it has told me that I should change things in the dependencies compile
because implementation
I have uploaded the compilation version to 27...
But gradle when doing build returns me the error:
Android dependency 'com.android.support.constraint:constraint-layout' has different version for the compile (1.0.2) and runtime (1.1.0) classpath. You should manually set the same version via DependencyResolution
I have reset the cache with (File -> Invalidate Caches/Restart -> Invalidate and Restart).
but it still gives the error
Of all the modules that I use, only one uses constraint-layout
and I have it
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
in principle it should be well established.
Searching by SO I have found the recommendation to use api
beforeimplementation
as follows
api 'com.android.support.constraint:constraint-layout:1.1.0'
And it has been mysteriously fixed...
My question is what is the difference in using implementation
or api
?
Something similar to yours 1 happened to me , so I was reading the Use the new dependency configurations section of the Android documentation.
There they explain the difference (bold is mine):
And finally, a note:
1 Related question: How to apply the new Android Studio dependency settings?