I have added firebase to my project using the wizard provided by AS, but when adding the dependency, it appears differently.
implementation 'com.google.firebase:firebase-auth:11.8.0'
But another google service compiles as follows:
compile 'com.google.firebase:firebase-core:11.8.0'
As you can see, only the word at the beginning changes. Now I would like to know the difference between implementation and complle or is it simply a synonym.
When updating the file, .gradle
it does not generate an error.
As of Gradle version 3.0, it
compile
is deprecated and you must useapi
orimplementation
.api
is used to include dependencies that will be exported by your library's API andimplementation
is used to include a dependency that will be used internally in your project.In short, on Android if you use Gradle 3.0 or higher you should use
implementation
instead ofcompile
.Gradle won't give you an error if you use
compile
, but it will eventually be removed and you'll have to use yes or yesimplementation
.You can see the documentation here (in English).
The main differences between compile and implementation are:
That implementation has many advantages and improvements over compile which are:
Faster compilation thanks to reduced classpath size.
Fewer recompiles when dependencies change.
Note: The compile configuration still exists, but should not be used as it will not provide the guarantees that api configurations provide.