Hi Everyone, Currently, I am facing an issue with ...
# multiplatform
s
Hi Everyone, Currently, I am facing an issue with the generation of the.aar file in the KMP project. The project architecture is like we have a root project, and inside that there are multiple modules (based on the functionality). I am able to create .aar for the modules successfully. But here the requirement is to generate a root-level.aar file, which must contain all modules.
p
By default the Android Gradle plugin does not support fat aars or multiple modules embedded in one aar. You can try this plugin: https://github.com/deepmedia/Grease
f
When you build an AAR file for root module, by default Gradle will not include the source code of its dependencies. There is a simple solution is to include all source code of its dependencies by adding it in build.gradle.kts of root module. Please note that : just enable it when you generate AAR file, comment it when you build the app to avoid duplicate code.
sourceSets {
getByName("main").java.srcDirs(
project(":child-module-1").projectDir.resolve("src/main/java"),
project(":child-module-2").projectDir.resolve("src/main/java"),
}