最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

android - How to Access the Version of an Installed AAR Library in build.gradle.kts? - Stack Overflow

programmeradmin4浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论