nativescript-community/ui-pager

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

Opened this issue · 3 comments

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

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

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

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
EddyVerbruggen/nativescript-barcodescanner#219
NathanaelA/nativescript-zxing#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.