EclipseLink jar contains some JPA classes. Android build APK fails:
Error:Execution failed for
task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException:
java.util.zip.ZipException: duplicate entry: javax/persistence/Access.class
Tried both exclude and pickFirst as following
packagingOptions {
exclude 'javax/persistence/**'
}
packagingOptions {
pickFirst 'javax/persistence/**'
}
packagingOptions {
pickFirst 'javax/persistence/Access.class'
}
None of them working.
Having the same requirement I searched for quite some time for a solution.
Unfortunately, at the time of writing, those options only work in app modules! They have no effect whatsoever in library modules.
You have to copy those options to all your final app modules.
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