I am using an AAR library in my Android project, and I need to extract the version of this library dynamically inside build.gradle.kts and inject it into BuildConfig.
Approaches tried
Accessing BuildConfig of the AAR Library I tried accessing the BuildConfig file inside the AAR library.
Issue: BuildConfig is generated per module and isn’t available at Gradle build time.
I attempted to extract the library version from configurations.implementation.
Issue: implementation dependencies are marked as canBeResolved=false, meaning they cannot be directly queried.
Running gradle app:dependencies prints all installed dependencies along with their versions.
Issue: While the version is displayed in the console, I couldn't find a way to access it programmatically inside build.gradle.kts.
Any help would be appreciated