I’ve got an Android project that has multiple modules. These are all Git submodules, and several of them are packaged with the same jars (android support v4, Guice, Roboguice, etc.). My main project also has these same dependencies, so I’ve got three copies of these jars, one in my project, and one in each of two submodules.
When I build, it fails at the dex stage, complaining that certain classes have already been added. I can hack around this, by getting rid of the jars from all the modules, except one, then pointing the dependencies to that location, but it just feels so dirty. There’s got to be a better way. Any suggestions?
Use a build tool like Maven or Ivy that manages dependencies for you, so you don’t have to check JARs into your project.