Why does gradle api configuration not leak the dependency library?

43 Views Asked by At

I forked a copy of UVCCamera library. It uses libcommon as follows:

api("com.serenegiant:common:4.1.1") {
    exclude module: 'support-v4'
}

Please note api instead of implementation is used. UVCCamera generates two aar files: libuvccamera-release.aar and usbCameraCommon-release.aar used by app Foo. libcommon has interface IAspectRatioView. I can trace it with Android Studio for my branch of UVCCamera:

enter image description here

You can see the interface is from com.serenegiant:common:4.1.1. However, app Foo cannot reference IAspectRatioView: enter image description here

I thought IAspectRatioView is supposed to be leaked by gradle api configuration.

However, I can trace declarations from AspectRatioTextureView of UVCCamera libary within the app project, I can see IAspectRatioView:

enter image description here

Could anyone shed some light on this?

0

There are 0 best solutions below