[TIMOB-16321] Android: Solution for building an app with modules that have conflicting jars
GitHub Issue | n/a |
Type | New Feature |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | CLI |
Labels | notable |
Reporter | Jon Alter |
Assignee | Chris Barber |
Created | 2014-01-27T20:53:08.000+0000 |
Updated | 2015-11-27T07:13:57.000+0000 |
Description
The problem
When building an app with two modules that use the same jar, only one jar can be used. If there are two jars, their hashes are compared by the CLI and if they match then we just use one of the jars. If the two jars do not match, then the build fails.
Workaround
Internally, we have this issue with ti.cloudpush, ti.map, and ti.geofence because they all use google-play-services.jar. To avoid this issue internally, we keep the all of the jars in sync, this means updating the other 2 modules when google play services is updated on one of them.
This does not solve the issue for anyone external who builds a module using play services and tries to run it along side one of these modules (or another external module with play services).
Notes
For the case of google play services, it should be ok to always use the latest version that is in the modules being run. Google does a pretty good job regarding backwards compatibility and it will not typically be an issue.
The problem with this approach is that there is no way for us to tell what version of the jar is newer. There is no meta data in the jar.
A possible solution might be to have a json file in the module that lists the jars used and their versions. The file must be maintained by the module developer. This would allow the CLI to choose the newest version of a jar.
This would solve the issue in the case of google play services ,but won't necessarily solve it in the case of other libraries as they may not have such good backwards compatibility.
Comments
JSON Source
No comments