Importing an .aar/.jar into a Multiplatform Library

We have a multiplatform module using the ‘kotlin-multiplatform’ gradle plugin and we need to be able to import and use the java classes from an .aar library. I’ve tried the most obvious way to import .aars, which is to import it as a module and include it in my multiplatform (MP) library as a dependency under androidMain.dependencies. However, I’m not able to access any of the classes from the .aar from a test Kotlin file under the androidMain src tree.

In an attempt to try something simpler, I created my own android java library (‘com.android.library’ plugin) in the same project as my MP library. I put a single class under the java src tree and imported that project as a dependency in a variety of places to no avail.

Has anyone tried managed to accomplish this? How can I debug what classes are accessible from the androidMain src tree in my MP project? If a project is added as a dependency successfully, what would prevent its classes from being accessible?

Thanks All

3 Likes