[TIMOB-23697] Hyperloop - Android - Dexer fails because of duplicated classes #46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://jira.appcelerator.org/browse/TIMOB-23697
This is a not-very-smart way to avoid the issue. Seems android build system ran into this issue itself in the past: http://tools.android.com/recent/dealingwithdependenciesinandroidprojects
Their solution is very slightly better than what I do here. Basically I treat any JAR file with the exact same base filename as being duplicates, skip adding any but the first and spit out a debug log message saying we're skipping it. I also special case android-support-v4 and -v13 like they do. (If both specified, use the latter).
Android does one more thing I didn't do here, which is if two files have the exact same base filename they check the file size/sha1 to see if they match. If they match they just ignore the duplicate, if they don't they fail the build. In our case we always skip the duplicate and spit out a debug log.