Search code examples
javaandroidandroid-studiogradleandroid-library

How to debug android library module in Android Studio?


I have an Android Studio project which contains a library module, which is added as another gradle project to it. I would like to debug the library code and set breakpoints on it.

What gradle settings should I use, if I want to debug a library module while running the app on emulator or real device ?


Update 1

this is the settings.gradle file :

include ':app'
include':my-library'

Solution

  • After a few days struggling I found the right configuration for being able to debug the library module :

    1- Create a project which consists of two modules, the app and the library-module

    2- Add direct module dependency to app , from the library-module. This is what the app's build.gradle :

    compile project(':library-module')
    

    3- Remove any automatic signing configuration added in the app build.gradle

    4- Remove these lines from both the app and library-module

    minifyEnabled true
    shrinkResources true