-
Notifications
You must be signed in to change notification settings - Fork 363
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
Exception: Multiple instances of SignalBus found #656
Comments
Hi ! Same issue with
|
I solved my issue by replacing my ProjectContext Installer by another installer in a parent scene. |
Same here. This line inside of SignalBusInstaller: Container.BindInterfacesAndSelfTo<SignalBus>().AsSingle().CopyIntoAllSubContainers(); But this line is cause of the problem in next cases: I haven't found solution yet. Update. I couldn't find smart solution. Than what I did:
Container.BindInterfacesAndSelfTo<SignalBus>().AsSingle();//.CopyIntoAllSubContainers();
Container.BindInterfacesTo<SignalDeclarationAsyncInitializer>().AsSingle();//.CopyIntoAllSubContainers();
Messy... but it works. |
Hello!
We have the following error:
When loading 3 scenes each with a SceneContext and parented using Contract Names and the SignalBus installed in the first scene we get the following exception when the third scene is loaded:
ZenjectException: Found multiple matches when only one was expected for type 'SignalBus' while building object with type 'SignalBus'. Object graph:
SceneKernel
DisposableManager
SignalBus
The second and third scene each install a component which gets the SignalBus injected.
I have created a simple project to reproduce the error. I'm on Windows 10 with Unity 2018.4.3f1 with Zenject 8.
To run the project open it in Unity and add '[email protected]
' (the GameSignalsInstaller from the sample game is used in the test project).
The main scene is called 'SignalBusIssueScene1' located in the folder 'SignalBusIssue'.
I also attached the output log from the build so you can see the whole stack trace of the exception.
output_log.txt
ZenjectSignalBusIssueProject.zip
The text was updated successfully, but these errors were encountered: