Arello-Mobile / Moxy

Moxy is MVP library for Android
https://github.com/Arello-Mobile/Moxy/wiki
MIT License
1.6k stars 207 forks source link

Androidx duplicate dependencies #258

Open pavelpoley opened 5 years ago

pavelpoley commented 5 years ago

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?

victorlapin commented 5 years ago

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

pavelpoley commented 5 years ago

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

bitizen248 commented 5 years ago

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

This worked for me

fmaxx commented 5 years ago

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"
morozione commented 4 years ago

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);
    }
ShwetaChauhan18 commented 4 years ago

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'
VovaStelmashchuk commented 4 years ago

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.