Android, Gradle and duplicate files error during packaging

23 views
Skip to first unread message

Andrej van der Zee

unread,
Mar 6, 2014, 2:20:21 PM3/6/14
to gradle-androi...@googlegroups.com

I want to use the json-schema-validator in my Android project like this:

dependencies { compile 'com.github.fge:json-schema-validator:2.1.8' }

Unfortunately Gradle stops packaging due to this file duplicate error:

Path in archive: draftv3/schema Origin 1: /Users/andrej/.gradle/caches/modules-2/files-2.1/com.github.fge/json-schema-validator/2.1.8/4c2a5be8ce86c2338561a651d7d22fb4c4a8763d/json-schema-validator-2.1.8.jar Origin 2: /Users/andrej/.gradle/caches/modules-2/files-2.1/com.github.fge/json-schema-core/1.1.9/4ead9ba3fb3bde69d93f738042d12a9e60e41645/json-schema-core-1.1.9.jar

I know I can ignore the file like this:

packagingOptions { exclude 'draftv3/schema' }

But the file is used by json-schema-validator and json-validator-core, so it is required in the resulting APK.

How can I force Gradle to proceed packaging while keeping one of the two versions of this file (they are equal)?

Thanks, 

Andrej

Reply all
Reply to author
Forward
0 new messages