Similarities and differences between implementation and compile in gradle files in Android

The same thing: all add dependencies to Module

Difference: implementation cannot rely on transitivity, but compile can. What does it mean? Experienced developers basically know that, for example, if an App depends on libA, and libA depends on libB, can the App call the methods in libB?

After verification, if App implements libA (libA implementation libB ), then App cannot call methods in libB, and if complie is used, App can call methods in libB

Of course, the recommendation is still implementation to avoid cross-dependency calls, resulting in excessive coupling between modules and confusing management.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325775241&siteId=291194637