fat-aar-android icon indicating copy to clipboard operation
fat-aar-android copied to clipboard

Try out Android Fused Library plugin instead

Open Goooler opened this issue 5 months ago • 5 comments

The Fused Library plugin bundled with Android Gradle Plugin assists with packaging multiple Android Library modules into a single publishable Android Library. This lets you to modularise your library's source code and resources within your build as you see fit, while avoiding exposure of your project's structure once distributed.

https://developer.android.com/build/publish-library/fused-library

Goooler avatar Jun 16 '25 08:06 Goooler

Good Job

kapaseker avatar Jun 16 '25 12:06 kapaseker

thank

MichaelNien avatar Jun 17 '25 00:06 MichaelNien

Only compatible with AGP 8.12 😭

ivandortulov avatar Jun 18 '25 09:06 ivandortulov

Only compatible with AGP 8.12 😭

you can create an empty project to do this.

kapaseker avatar Jun 19 '25 00:06 kapaseker

这种是针对 include(project(":project-xxx")) 的方式, 用 include(files("libs/xx.aar")) 的方式并没有生效(readme 文件中 Configurations 的 include 描述有提到不支持 libs/jars 以外的文件), 但是还是希望: 能支持直接基于 aar 文件的合并方式吗? 万分感谢.


This is the way for include(project(":project-xxx")). Use the include(files("libs/xx.aar")) does not work(The description of include in Configurations in the readme file mentions that files other than libs/jars are not supported). However, I still hope that the merge method based directly on aar file can be supported? Thanks.

liuanxin avatar Jun 20 '25 03:06 liuanxin

Why the Fused Library plugin dependency has only a pom ,not jar ? I can't download it to my project by dependence. https://mvnrepository.com/artifact/com.android.fused-library/com.android.fused-library.gradle.plugin/8.12.0-alpha07

mahongbobobo avatar Jul 01 '25 09:07 mahongbobobo

你提的这是傻逼问题

Goooler avatar Jul 01 '25 09:07 Goooler

新手刚入门。多多包涵。引入后报错信息是这样的,能帮忙指点一下吗?万分感谢

  • Plugin Repositories (could not resolve plugin artifact 'com.android.fused-library:com.android.fused-library.gradle.plugin:8.10.1')

mahongbobobo avatar Jul 01 '25 11:07 mahongbobobo

新手刚入门。多多包涵。引入后报错信息是这样的,能帮忙指点一下吗?万分感谢

* Plugin Repositories (could not resolve plugin artifact 'com.android.fused-library:com.android.fused-library.gradle.plugin:8.10.1')

你有引入google的maven库吗?

pluginManagement {
    repositories {
        google {
            content {
                includeGroupByRegex("com\\.android.*")
                includeGroupByRegex("com\\.google.*")
                includeGroupByRegex("androidx.*")
            }
        }
        mavenCentral()
        gradlePluginPortal()
    }
}

kapaseker avatar Jul 02 '25 00:07 kapaseker

新手刚入门。多多包涵。引入后报错信息是这样的,能帮忙指点一下吗?万分感谢

* Plugin Repositories (could not resolve plugin artifact 'com.android.fused-library:com.android.fused-library.gradle.plugin:8.10.1')

你有引入google的maven库吗?

pluginManagement { repositories { google { content { includeGroupByRegex("com\.android.") includeGroupByRegex("com\.google.") includeGroupByRegex("androidx.*") } } mavenCentral() gradlePluginPortal() } }

感谢指导,我找到了另外的可替代产品,https://github.com/aasitnikov/fat-aar-android?tab=readme-ov-file

mahongbobobo avatar Jul 02 '25 04:07 mahongbobobo

请问, Fused Library 对 databinding 有支持计划吗?


Is there a plan for Fused Library to support databinding?

liuanxin avatar Jul 02 '25 10:07 liuanxin

Be aware that Fused library is still on early stages. Besides not supporting databinding (I think it never will) and requiring gradle 8.12+, you also can't use any BOM dependencies.

lhalegria avatar Sep 01 '25 14:09 lhalegria

Is there a way to deliver a consumer-rules.pro file to projects that use this library, or is that not supported? For now, we’ve had to add the required rules directly to the consuming project’s proguard-rules.pro.

gay00ung avatar Sep 29 '25 02:09 gay00ung

We do have an open issue to support code/resources shrinking in fused library. See the IssueTracker for the status: issue 346984969. We're intenteding to work it once the plugin is stable, likely AGP 9.0.

lukeedgargoogle avatar Oct 16 '25 14:10 lukeedgargoogle