Moxy icon indicating copy to clipboard operation
Moxy copied to clipboard

Androidx duplicate dependencies

Open pavelpoley opened this issue 5 years ago • 7 comments

I started AndroidX project, i am using this dependencies:

`  //implementation "com.arello-mobile:moxy:$moxy"

    implementation "com.arello-mobile:moxy-app-compat:$moxy"

    annotationProcessor "com.arello-mobile:moxy-compiler:$moxy"

    implementation 'tech.schoolhelper:moxy-x-androidx:1.7.0'`

but in build process getting this error:

Duplicate class com.arellomobile.mvp.DefaultView found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.DefaultViewState found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.InjectViewState found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.MvpAppCompatActivity found in modules jetified-moxy-app-compat-1.5.5.jar (com.arello-mobile:moxy-app-compat:1.5.5) and moxy-x-androidx-1.7.0.jar (tech.schoolhelper:moxy-x-androidx:1.7.0) Duplicate class com.arellomobile.mvp.MvpAppCompatDialogFragment found in modules jetified-moxy-app-compat-1.5.5.jar (com.arello-mobile:moxy-app-compat:1.5.5) and moxy-x-androidx-1.7.0.jar (tech.schoolhelper:moxy-x-androidx:1.7.0) Duplicate class com.arellomobile.mvp.MvpAppCompatFragment found in modules jetified-moxy-app-compat-1.5.5.jar (com.arello-mobile:moxy-app-compat:1.5.5) and moxy-x-androidx-1.7.0.jar (tech.schoolhelper:moxy-x-androidx:1.7.0) Duplicate class com.arellomobile.mvp.MvpDelegate found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.MvpFacade found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.MvpPresenter found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.MvpPresenter$Binder found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.MvpProcessor found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.MvpView found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.PresenterBinder found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.PresenterStore found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.PresentersCounter found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.RegisterMoxyReflectorPackages found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.ViewStateProvider found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.presenter.InjectPresenter found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.presenter.PresenterField found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.presenter.ProvidePresenter found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.presenter.ProvidePresenterTag found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.viewstate.MvpViewState found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.viewstate.ViewCommand found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.viewstate.ViewCommands found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.viewstate.strategy.AddToEndStrategy found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.viewstate.strategy.OneExecutionStateStrategy found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.viewstate.strategy.SingleStateStrategy found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.viewstate.strategy.SkipStrategy found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.viewstate.strategy.StateStrategy found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0) Duplicate class com.arellomobile.mvp.viewstate.strategy.StateStrategyType found in modules moxy-1.5.5.jar (com.arello-mobile:moxy:1.5.5) and moxy-x-1.7.0.jar (tech.schoolhelper:moxy-x:1.7.0)

How to resolve this errors?

pavelpoley avatar Jun 26 '19 12:06 pavelpoley

Don't mix dependencies, add only moxy-x or moxy

victorlapin avatar Jun 27 '19 10:06 victorlapin

if i add only implementation 'tech.schoolhelper:moxy-x-androidx:1.7.0' all classes related to presenters not found

pavelpoley avatar Jun 27 '19 10:06 pavelpoley

Use should also use custom Moxy https://github.com/schoolhelper/MoxyX

This worked for me

bitizen248 avatar Jun 27 '19 20:06 bitizen248

that works on my Android-x project ($versions.moxy = 1.7.0):

 implementation "tech.schoolhelper:moxy-x:$versions.moxy"
 implementation "tech.schoolhelper:moxy-x-android:$versions.moxy"
 annotationProcessor "tech.schoolhelper:moxy-x-compiler:$versions.moxy"

fmaxx avatar Sep 13 '19 07:09 fmaxx

You can solve the problem by don't add implementation "com.arello-mobile:moxy-app-compat:$moxy" to your project but instead of this you can create your class com.arellomobile.mvp.MvpAppCompatActivity with the code from this repository but with the dependency on androidX and use it as well. Here is come a couple of code:

package com.arellomobile.mvp;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;

@SuppressWarnings("unused")
public class MvpAppCompatActivity extends AppCompatActivity {
    private MvpDelegate<? extends MvpAppCompatActivity> mMvpDelegate;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        getMvpDelegate().onCreate(savedInstanceState);
    }

morozione avatar Nov 26 '19 18:11 morozione

this works on my Android-x project

  implementation 'tech.schoolhelper:moxy-x:1.7.0'
  implementation 'tech.schoolhelper:moxy-x-androidx:1.7.0'
  kapt 'tech.schoolhelper:moxy-x-compiler:1.7.0'

ShwetaChauhan18 avatar Mar 27 '20 10:03 ShwetaChauhan18

Hi, all Check a new version of moxy [https://github.com/moxy-community/Moxy](New Moxy).

This repo and repo of tech.schoolhelper are not up to date.

VovaStelmashchuk avatar Mar 27 '20 10:03 VovaStelmashchuk