How to debug koltin aar file on android

i wrote the android library using kotlin. generated aar file. i’m using that aar file on other project. i’m unable to debug the source file on aar file. please help me how to resolve this issue

I’ll assume you are using gradle and have access to the source of the app project.

Edit settings.gradle in the app project to have something like this:

include ':mylibrary'; project(':mylibrary').projectDir = file("path/to/coollibraryproject/mylibrary")

And change your dependency from:

implementation "my.stuff:mylibrary:1.0.0"


implementation project(':mylibrary')

Hope that helps you out. Note that this is not specific to Kotlin or Android, this pattern should work for any gradle project.

Check here:

While debugging when it prompt “Choose Sources”, Click on that option and select the “main” folder of the library module from your local codebase of the library.

Now try to debug (by choosing ‘step into’ option etc), the debugger should able to get the source code.