I have an Android application which relies on RxAndroid (based on RxJava2). I've also added the RxAdnroidBle dependency which still uses RxJava1.
During compilation I had the following error:
Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/rxjava.properties
File1: /home/eddy/.gradle/caches/modules-2/files-2.1/io.reactivex.rxjava2/rxjava/2.1.0/2fdf84dedcaaeabb9d70cde9dbb8aad4eccb80a1/rxjava-2.1.0.jar
File2: /home/eddy/.gradle/caches/modules-2/files-2.1/io.reactivex/rxjava/1.3.0/af000bec2036a2a9d07197c4b03b8966bfc60b03/rxjava-1.3.0.jar
Which I solved by adding the following block to build.gradle
:
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
I seems that everything works fine. But just to make sure - having both RxJava 1 & 2 libraries as dependencies may cause any problems?
Thanks,