nativescript-community / ui-pager

Pager / Carousel component that allows the user to swipe left and right through pages of data.
https://nativescript-community.github.io/ui-pager/
Apache License 2.0
18 stars 10 forks source link

[Android] Dependency collision with @nstudio/nativescript-carousel #16

Open timoschlueter opened 2 years ago

timoschlueter commented 2 years ago

Hi everyone,

I ran into problem today with this plugin in combination with another NativeScript plugin (@nstudio/nativescript-carousel). Both plugins in their latest versions make use of the PageIndicatorView. When both plugins are used in the same project, the build process for Android fails with the following message:

Execution failed for task ':app:checkReleaseDuplicateClasses'.
Duplicate class com.rd.IndicatorManager found in modules jetified-PageIndicatorView-1.0.6-runtime (com.github.adrielcafe:PageIndicatorView:1.0.6) and jetified-PageIndicatorView-b1bad589b5-runtime (com.github.romandanylyk:PageIndicatorView:b1bad589b5)
Duplicate class com.rd.IndicatorManager$Listener found in modules jetified-PageIndicatorView-1.0.6-runtime (com.github.adrielcafe:PageIndicatorView:1.0.6) and jetified-PageIndicatorView-b1bad589b5-runtime (com.github.romandanylyk:PageIndicatorView:b1bad589b5)
Duplicate class com.rd.PageIndicatorView found in modules jetified-PageIndicatorView-1.0.6-runtime (com.github.adrielcafe:PageIndicatorView:1.0.6) and jetified-PageIndicatorView-b1bad589b5-runtime (com.github.romandanylyk:PageIndicatorView:b1bad589b5)

Digging deeper into this i found out that there is a collision between the two plugins:

@nativescript-community/ui-pager

    implementation 'com.github.adrielcafe:PageIndicatorView:1.0.6'

See here

@nstudio/nativescript-carousel

    implementation 'com.github.romandanylyk:PageIndicatorView:b1bad589b5'

See here

It there any solution for this issue? What is the difference between the two implementations? I think both plugins should be able to work in the same project.

bk-js commented 2 years ago

I ran into the same issue. Any updates on this?

timoschlueter commented 2 years ago

Unfortunately not. We did not find a solution for this yet. :/

lucasumberto commented 2 years ago

I was upgrading my app, after 2 years and got this error... Both plugins implements same classes, and break the build. I was trying to solve using those topics as help, but I got no luck... maybe help someone:

https://stackoverflow.com/questions/56695106/duplicated-classes-found-in-modules-classes-jar https://github.com/EddyVerbruggen/nativescript-barcodescanner/issues/219 https://github.com/NathanaelA/nativescript-zxing/issues/4 https://stackoverflow.com/questions/59600981/getting-error-execution-failed-for-task-appcheckdebugduplicateclasses https://developer.android.com/studio/build/dependencies

As I remember I choose to use both plugins because a problem to use one of them (I don't remember which one) did not work in one of the platforms so i opted to use Carrousel for iOS and Pager for android.

Maybe now I can use only one plugin for both, I will try it now. Edit: my carousel implementation doesn't worked in Android, but Pager worked for IOS. so I will keep the pager (but unfortunately Carousel is prettier on iOS)..

Ah.. another information is that this problem only happens on android build.