hello everyone, how can I create a module that can...
# gradle
g
hello everyone, how can I create a module that can be compiled as an Android
aar
and a
Java JAR
library? I’ve been messing with targetSources the Android and Java plugins, but no success 😞 For more detailed context, what I need is a module just with the Compose Multiplatform dependencies and my own composables. And to add it as a dependency in the compatible targets (I can’t add it to comonMain since I’m also using a Kotlin JS target which can’t manage Compose Multiplatform), so I’ll add it manually to the Android, iOS and Desktop targets.
g
Your goal look clear, but I'm not quite sure why you need
aar
and
jar
at the same time for it Why not just jar?
in general, mixing java and android plugins is always a path of despair
g
Thank you for your answer Andrey, when imported in Android it’s better to import an
aar
and in JVM as
jar
. Anyway I’m experimenting doing it as a Multiplatform library considering some info that I’ve found. I’ll share my results here for anyone to know if I’m successful. 🙂
g
> when imported in Android it’s better to import an
aar
Why? It's not requirement. Yes, jar has less features, but it absoltely fine to use jar, many libs used on android are pure jvm ones and use jar So if you library doesn't expose anything android specific (like resources) I don't see a reason why it should be aar?