Android exception
https://github.com/modesttree/Zenject/issues/631
That's interesting, that sounds more like the kind of error you would get due to IL2CPP code-stripping, but you aren't using IL2CPP
I tried to reproduce this using the sample projects in both Unity 2019.1.0f2 and Unity 2018.3.12f1 but it worked as expected
I've updated to Extenject 8.0.1 and still getting the same error. Its definitely a Mono NET 4.5 build not IL2CPP. If it is code stripping, which I thought it might be, is there some way I can mark it as do not remove? There isn't actually a constructor defined in that class but I guess it should automatically be created
Yeah I remember getting that error in the past with IL2CPP sometimes. The workaround was to not only define a constructor but also add the [Inject] attribute. And since InjectAttribute inherits from PreserveAttribute, IL2CPP is guaranteed to not strip it. But I didn't think that workaround was necessary anymore since I thought constructors are included by default now. Also, I thought code stripping was only something that occurred with IL2CPP, so I can't really explain this. If you can provide a minimal example I can look into it further though
Any news about this issue?
The workaround solution that works for me was add default constructor for all my non MonoBehaviour classes manualy, and add a Inject attribute for them. Also I did the same thing for some classes into Zenject.
I needed to add empty constructors with [Inject] to ZenjectManagersInstaller, SceneContextRegistryAdderAndRemover, SceneContextRegistry. Android build with Mono, Unity 2020.3.3f1 with Zenject 9.20.
The code is probably erased (unused code is deleted) during the build. Usually this is code that is not called directly, but through reflection. This happens on the Inject attribute. It is necessary to look for something like Strip Code Level in the Project Setting -> Player -> Other settings and select the most minimal one or disable it altogether.