This a bit odd or I have some misunderstanding about dependencies. How LeakCanary can be installed and ready to observe my application for memory leaks only by adding it to the dependencies in the app's Gradle file?
On Android, Content providers are created after the Application instance is created but before Application.onCreate() is called. LeakCanary has a ContentProvider defined in the library AndroidManifest.xml file. When that ContentProvider is installed, LeakCanary adds activity and fragment lifecycle listeners to the application.