question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FactoryRegistry and MemberInjectorRegistry are not generated for module

See original GitHub issue

Hi! I use this guide for setup multi module project. I have two module: auth and app: module auth has dependencies

api "com.github.stephanenicolas.toothpick:toothpick-runtime:$versions.toothpik"
kapt "com.github.stephanenicolas.toothpick:toothpick-compiler:$versions.toothpik"

and module app has configurations for kapt

kapt {
    generateStubs true
    arguments {
        arg("toothpick_registry_package_name", appId)
        arg('toothpick_registry_children_package_names', "ru.rm.auth")
    }
} 

and dependencies

implementation project(':auth')
kapt "com.github.stephanenicolas.toothpick:toothpick-compiler:$versions.toothpik"

But after clean/rebuild I have build exceptions error: cannot find symbol addChildRegistry(new ru.rm.auth.FactoryRegistry()); and error: cannot find symbol addChildRegistry(new ru.skblab.rm.auth.MemberInjectorRegistry());

I try it with android gradle plugin version 3.1.2 and 3.2.0-alpha15 and gradle version 4.4.1 and 4.7 respectively

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rovkinmaxcommented, Aug 28, 2018

try to add injection for some field, for example, in fragment or activity in module

1reaction
stephanenicolascommented, Jun 17, 2018

You re right, this sentence doesn’t make sense. We should fix it,please don’t close the ticket to remind us.

All libs using TP will have to be compiled using the TP annotation processors, refection or not.

If you use registries, all libs will have to include a registry (in its own distinct package).

If you don’t, we still the libs to be annotation processed to generate the factories and member injectors.

So, yes, you need TP to compile all lib modules. They can use the TP libs as implementation scope and then you will have to use TP libs in your app. You can also include it in the api scope for libs and your app won’t need to declare it as a dependency.

If you use registries, they should be declared as API. But it’s a detail.

Thx for raising the issue.

On Sat, Jun 16, 2018, 05:35 SergJ4, notifications@github.com wrote:

Hi! I’ve read this guide https://github.com/stephanenicolas/toothpick/wiki/Factory-and-Member-Injector-registries#example--application-with-3-libraries too. It says that: The only problem with the registries approach (beyond the extra configuration steps) is that every library using DI and that will be used by Toothpick needs to be compiled with Toothpick. So I thought that I don’t need to include TP dependency in every project module if I will use reflection feature. But it TP library still should be included into each module in order to generate MemberInjectorFactories. If I will not include it, than nothing will be injected at runtime in modules classes. Did I missed something? Must TP library be included in every module in multi module projects regardless is reflection enabled or disabled? Or maybe there is some configuration option, that allows to generate all MemberInjectorFactories in one module?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stephanenicolas/toothpick/issues/293#issuecomment-397809401, or mute the thread https://github.com/notifications/unsubscribe-auth/ABv33T9p5iZxuzCuHYD1W9OwI1cYQMhWks5t9PuXgaJpZM4UIJ69 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dagger 2 component not generated - Stack Overflow
I have a Component class where I inject objects and a ModuleClass where I provide objects to inject. What can be the cause...
Read more >
Create an Android library - Android Developers
An Android library is structurally the same as an Android app module. It can include everything needed to build an app, including source...
Read more >
View Binding classes are not resolved in Studio 4.0+ when ...
When two independent modules in a project have the same application ID and a layout of the same name, the generated View Binding...
Read more >
Stop generating the BuildConfig on your Android modules
It's important to highlight that I am not talking about the app module BuildConfig , I am talking about all the other BuildConfig...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found