I am trying to build an aar from a KMP library I j...
# multiplatform
r
I am trying to build an aar from a KMP library I just created but running PublishToMavenLocal seems to be creating two aar’s debug and release with size in some 100 kbs which doesn’t seem right. Both of them are in build/outputs/aar folder. Please can anyone help me with what I may be doing wrong. Attached is my build.gradle file
a
what is wrong with this release/debug aar`s that you are seeing? If you are not doing a lot of stuff in your library. 100k might be a fair size for aar. At least mine aar`s are around 400-500kb
r
The problem is that when I use the said aar file in android app the following comes
Copy code
java.lang.RuntimeException: Unable to instantiate application com.rawat.address.AddressApp: java.lang.TypeNotPresentException: Type kotlinx.serialization.json.Json not present
a
@Rahul Rawat I do not see that you setup group/artifact/version in you maven publication. Do you see pom file generated? You must have it so that gradle can bring dependencies you multiplatform depends on.
r
@Anton Afanasev Can you please direct me on how to do that 🙏
r
Thanks for your help Anton now I am able to build the pom as attached but it seems the real problem has been android studio not being able to transitively add dependencies. Following is how I am adding the aar to my android project
Copy code
implementation files('libs/AddressLibrary-android-1.0-SNAPSHOT.aar')
Can you help out how to transitively add depedencies in the android project. I have the sources.jar, pom, aar and maven-metadata in my libs folder