andriydruk / RxDNSSD

Android version of mDNSResponder
Apache License 2.0
297 stars 75 forks source link

DexArchiveMergerException Unable to merge dex #30

Closed G00fY2 closed 6 years ago

G00fY2 commented 6 years ago

After upgrading from 0.9.1 to 0.9.3 (no other changes made) I had to additionally add the rxjava dependency to my build.gradle because the rx.Subscription package was unknown.

But now my build fails with an DexArchiveMergerException: Duplicate zip entry [61.jar:rx/annotations/Experimental.class]

Not sure but I guess changing rxjava implementation to api in your rxdnssd/build.gradle may fix the problem in my case.

PS: I also use RxJava2 in this project, but it's perfectly working side by side with 0.9.1.

andriydruk commented 6 years ago

In 0.9.3 I updated rxjava from compile 'io.reactivex:rxjava:1.1.3' to implementation 'io.reactivex:rxjava:1.3.0'

I guess it's a problem of using RxJava1 and RxJava2 in same project Proper solution is implement #15

andriydruk commented 6 years ago

Try to use the same version of RxJava 1 as I mentioned above I will try to fix it soon

G00fY2 commented 6 years ago

Sorry, I had to add rxandroid not rxjava to my build.gradle to resolve the missing rx.Subscription package. So the problem seems to relate to rxandroid.

What I did now was to locally import your dnssd (library) and rxdnssd module into my project and change the rxdnssd/build.gradle to api 'io.reactivex:rxandroid:1.2.1'. The compile error disappeared.

andriydruk commented 6 years ago

Ok, I will fix it today/tommorow Thanks

andriydruk commented 6 years ago

Fixed 0.9.4

G00fY2 commented 6 years ago

Can test this on Monday. But actually not sure if it will work for me since I needed to expose rxandroid via api configuration and not rxjava.

G00fY2 commented 6 years ago

Sorry for my late response. Was finally able to test the new version. After struggling to set everything up it's working now.

But I still had to add all the following dependencies to my submodule gradle to be able to use the new version:

implementation 'io.reactivex:rxjava:1.3.4'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'com.github.andriydruk:dnssd:0.9.5'
api 'com.github.andriydruk:rxdnssd:0.9.5'

compared to before with 0.9.1

api 'com.github.andriydruk:rxdnssd:0.9.1'

Not sure if there is something you can do form the side of your library or if it's because the new gradle dependency scoping. Took me some time to notice that I need the com.github.andriydruk:dnssd:0.9.5 dependency too now. Without that I the app compiled but I got a NoClassDefFoundError RuntimeException because of RxDnssdBindable.

namannik commented 6 years ago

In order to upgrade from 0.9.1 to 0.9.5, I had to add these dependencies also. Thanks, @G00fY2 for posting what worked for you.