Common issues

IssueCause and solution
A member is null in Awake.Selvage injects members at the end of Awake. Use the member from Start or OnEnable, or call Manual.Inject(this) before you use it.
A member is null, and the Console window displays an error.The member's dependency is missing. Check the member's row in the Validation tab for the reason, then add a provider for the type, or make the member Optional.
A member keeps the value you assigned.Selvage injects only members that hold null. Remove the value, or use Overwrite.
A dependency that loads is never injected.The member can't wait for it. Use the Async option.
A Reactive member never changes.A Reactive member follows the changes its provider announces, and a provider added above that provider. The Scene Provider announces nothing for a component that's created or destroyed, unless the object is watched. Enable Watched on the object's Provide Tuning component, or call Manual.Reinject. For more information, refer to Reactive.
A member receives an unexpected object.Another provider gives the dependency first. Use Explain to find it, then reorder the provider list or add a preference.
The Console window, or a member's row in the Validation tab, displays could be injected and nothing tells them apart.Several candidates fit the member equally. Add a preference to one of them.
An IL2CPP build fails with Selvage: IL2CPP may strip, followed by a list of members and types.Selvage reaches these members through reflection, because their classes come from a precompiled DLL, so IL2CPP can strip them. Add the [Preserve] attribute to each one, or add a link.xml entry. For more information, refer to IL2CPP and AOT.
A type from a precompiled DLL isn't injected.Selvage doesn't process precompiled DLLs. Call Manual.Inject(obj) after you create the object, and Manual.Release(obj) when you no longer need it.
Two classes that inject each other are Missing.Both classes have the Separate lifetime, so each new instance needs another new instance, and the loop never ends. Make one of them Shared, or make one of the members Manual.
Two dependencies that hold each other never end.Each keeps the other alive. Make one of the members Weak.
No member is ever injected, and the Console window displays Selvage: automatic injection is off.Selvage couldn't add injection to your scripts when Unity compiled them. If the message names the Mono Cecil package, install com.unity.nuget.mono-cecil. For more information, refer to Install the package. If the message names one assembly or class, only that one is affected: it's injected only by Manual.Inject until you fix the cause the message gives. Otherwise, fix the compile error the Console window displays.
The Console window displays classes are marked [Provide] ... but the provider list ... has no Attribute Provider that is on.The Attribute Provider is missing from the provider list, or code turned it off. Add it in the provider list. For more information, refer to Manage the provider list.
The Console window displays has its class in the editor-only assembly when you build.A provider in the provider list is declared in an Editor assembly, so a build doesn't have it. Move its class to a runtime assembly.
The Console window displays a block opened with Injector.Local ... was still open at the end of the frame.A local block was never ended, so Selvage ended it. Open the block in a using statement. For more information, refer to Pass objects in a local block.
The Console window displays exists but could not be read, so the settings fall back to their defaults.The settings file is damaged, such as by a merge conflict, so Selvage uses the default settings and doesn't overwrite the file. Restore the file from version control and reopen the project, or delete it to start from the default settings.

Find out what happened

To find out why a member didn't receive what you expected, check the following, in order:

  1. The member's row in the Validation tab, and its reason.
  2. Explain on that row, which lists what each provider did.
  3. The order of the provider list, in Edit > Project Settings > Selvage.
  4. The Console window. Every message from Selvage starts with Selvage:.
  5. The Live tab, which displays what the member holds.

Support

For questions and bug reports, use the contact form or email justetools@gmail.com, with what you expected and what happened.

Additional resources