Consuming a Library Module

If somebody else has created a library module in your project, you can depend upon it from some other module using the same sort of implementation statement that we use to depend upon Google-supplied and third-party libraries. The difference is that rather than using a string like androidx.constraintlayout:constraintlayout:2.0.4 to identify the library, you use project(":..."), where ... represents the name of the module.

So, for example, an app module that wants to use the Utilities module would have:

  coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.