0

I have a project like this:

Project | --Lib1 | --Lib2 | --Lib1 --Lib3 | --Lib1 

Lib1 is a common dependency for Project, Lib2, and Lib3. How should I configure the build.gradle files?

1 Answer 1

1

For the projects dependent on Lib1 you should add it as a dependency in the following way:

dependencies { compile project(':Lib1') } 

This specific case is available in gradle user guide Section 7.3.3. Dependencies between projects or you can find a more comprehensive description of dependencies declarations in Section 51.4. Module Dependencies

Sign up to request clarification or add additional context in comments.

2 Comments

this method does not work. Because linker make error duplicate dex file.
Is this duplicate dex file somehow related to your build? I.e. is it one of the artifacts produced by your build or something your build takes dependency on?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.