How to link without copying the library project to Android Studio?

Yes, everywhere I can learn how to make a module from a project that will copy the library project. But this is not good, since a change in the library project must be replicated for each project that uses it. So, how can I refer to it from a folder outside the project dynamically?

+6
source share
1 answer

Got: In your project, go to settings.gradle and declare something like this: include ':LibReferenceName' project(':LibReferenceName').projectDir = new File(settingsDir, '../relativePath/toThe/libraryModule/fromTheProject')

And in modules requiring libraries, include something like this in build.gradle: compile project(path: ':LibReferenceName')

You also cannot use settingsDir and just put the absolute path to the project.

+9
source

Source: https://habr.com/ru/post/971545/


All Articles