Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in MoxyReflector class in project with several modules #220

Open
btow opened this issue Aug 15, 2018 · 8 comments
Open

Error in MoxyReflector class in project with several modules #220

btow opened this issue Aug 15, 2018 · 8 comments
Labels
Milestone

Comments

@btow
Copy link

btow commented Aug 15, 2018

The kotlin-project has the following structure:

  • App 1 (with Moxy)
  • App 2 (with Moxy)
  • Library 1 (with Moxy)
  • Library 2
  • Library 3.

Library 3 is available from the Library 2, and Library 2 from Library 1. Library 1 must be available from both applications. For this, I added the following instruction to the "defaultConfig { }" section of the "build.gradle " file from Libraries 1:

   kapt {
        arguments {
            arg("moxyReflectorPackage", "top.inttech.app.employment_service")
        }
    }

"@RegisterMoxyReflectorPackages("top.inttech.app.employment_service")" annotation is added to the App class of application.
When you try to build the file, you receive an error message:

   ...\build\generated\source\kapt\debug\top\inttech\app\employment_service\MoxyReflector.java:34: error: cannot find symbol
	return viewStateProvider.getViewState();
	       ^
     symbol:   variable viewStateProvider
     location: class MoxyReflector
   ...\build\generated\source\kapt\debug\top\inttech\app\employment_service\MoxyReflector.java:38: error: incompatible types: Map<Class<?>,Object> cannot be converted to Map<Class<?>,List<Object>>
	return sViewStateProviders;
	       ^
     2 errors

How can I avoid this error?

@jkstop
Copy link

jkstop commented Aug 15, 2018

Just downgraded to 1.5.3 and all is OK

1.5.5 has this bug

@btow
Copy link
Author

btow commented Aug 16, 2018

I hope this bug will be fixed in the next version?

@jkstop
Copy link

jkstop commented Aug 16, 2018

I hope this too

@KeyStarr
Copy link

KeyStarr commented Aug 27, 2018

Well, in my case i have the following module structure for the ui layer:

  • App module (where the bottom bar is and where the navigation happens)
  • Submodule 1
  • Submodule 2
    etc.

App depends on all the ui submodules. I've put the @RegisterMoxyReflectorPackages there, and those kapt arguments in build.gradle files of the ui submodules.

I am facing the very same issue described in the topic.

Retreating back to moxy 1.5.3 worked (@btow thank you very much for this idea).

@senneco senneco added the bug label Oct 15, 2018
@senneco senneco added this to the 1.5.6 milestone Oct 15, 2018
@senneco
Copy link
Collaborator

senneco commented Oct 15, 2018

@ekursakov could you help please? This problem doesn't flaky at 1.5.3.

@isivkov-issart
Copy link

Having the same problem with 1.5.5. Downgrading to 1.5.3 leads to duplicate ...View$$State classes.

@vadimbryl
Copy link

@senneco Hi,
Could you take a look at 'Fix generation of MoxyReflector in library modules' PR?

@vkotovv
Copy link

vkotovv commented Mar 5, 2019

@senneco @ekursakov Looks like it was fixed in #232. Any plans to confirm this and make a new release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants