1

I am working on a Android Library. I need to use various open source libraries like volley, socket.io etc. Should I add dependency in build.gradle file or Should I include the source code as a package in my library module ?

Since Volley and Socket.io are pretty common libraries, I want to avoid any type of conflict in the future? It should work well under following coditions.

  1. User adds the same library (jar, gradle dependency)
  2. Difference in version added by user (say Volley, included is 1.0, and user adds 1.2).

I need to export the library to jCenter;

There aren't much resources available, the one which are available, are complex.

1
  • Add dependencies in the build.gradle file. And let your users to decide what should they do to resolve issues. Commented Sep 22, 2015 at 11:45

1 Answer 1

1

If you want that your library uses specific version all the time then you should include dependencies by sources and rename packages to avoid dex issues for clients if they going to use same library.

I would still state dependencies in build.gradle and allow client of the library to decide about dependency conflict resolution

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.