In my android project I have included two libraries as JARs into libs folder. And I add them to the build Gradle as below.
dependencies {
compile files('libs/siddhi-core-4.0.0-M13-SNAPSHOT.jar')
compile files('libs/siddhi-execution-math-4.0.2-SNAPSHOT.jar')
}
Those two jar files the have a file with the same name ("org.wso2.siddhi.annotation.Extension") but with different content. And both files are important for the project. Since it has same name gradle won't build saying
Duplicate files copied in APK
How can I merge those two files into one single file with the same name? Those two files are text files with a list of Class names. In two files they have two different lists. So I want to merge them into one list in a text file with same name.
Finally I found the answer. In the app build gradle you can specify to merge the conflicting files.
packagingOptions {
merge 'META-INF/annotations/org.wso2.siddhi.annotation.Extension'
}
for details look here https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With