Hello.
My team is ready to make pre-production build. In our project we use Zenject framework + UniRx. We’ve got dev build and now I’m trying to build WebGL for release. But unfortunately, an application, that made as a release build, throws exception during runtime:
46d1010d-e005-4d4b-8fc5-801f2bc343c0:8 ExecutionEngineException: Attempting to call method ‘Zenject.PlaceholderFactory`3[[Model.UnlockType, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[Model.ILocker, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::.ctor’ for which no ahead of time (AOT) code was generated.
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[ ] parameters) [0x00000] in <00000000000000000000000000000000>:0
Rethrow as ZenjectException: Error occurred while instantiating object with type ‘PlaceholderFactory<UnlockType, string, ILocker>’
at Zenject.DiContainer.InstantiateInternal (System.Type concreteType, System.Boolean autoInject, System.Collections.Generic.List`1[T] extraArgs, Zenject.InjectContext context, System.Object concreteIdentifier) [0x00000] in <00000000000000000000000000000000>:0
(Filename: currently not available on il2cpp Line: -1)
I suppose that next line of bind installer causes the exception:
Container.BindIFactory<UnlockType, string, ILocker>().FromFactory<LockerFactory>();
I found that because of WebGL is AOT platform I have to force the compilation of reflected members and types ahead of time as written here:
So I download Bolt package from Asset Store and add Zenject libraries here:
I used pre-build option as it mentioned in manual and got two files: aotScrubs.cs with a lot of commented lines and link.xml.
Now I can’t find docs what I have to do next. I’ve tried to make release build again but nothing has changed.
Please tell me what I’m doing wrong.
Thanks for any help.