Your comments

For anyone facing the same problem, here's what fixed this deadlock for me:

1) Delete the type from build options, generate

2) Remove AotStubs.cs

3) Add the file again into build options, generate

4) Run AOT pre build

------- EDIT: -------

After I fixed this, I made a commit+push. Then my teammate pulled the changes and for him Bolt was a mess:

1) Storage type was not listed in the build unit options at all

2) Despite that, Storage type was available in the graphs, but presented only some methods.

So he had to go through the same process again...  

Hi Lazlo,

I have spent another day fighting this issue and I have some more info.

So I had the same error after adding a custom type to build options. This time, a small custom static class that had some private generic methods. AOT Pre-Build was fired, of course. Also,The crash was happening only if I used Development Mode in the build process.

Rebuilding unit options couldn't fix this so I cleared my Library folder. Then I had to rebuilt the options, fire AOT Pre-build again and the bud finally went away. 

It seems that Library folder gets corrupted when adding custom types somehow :/ 

One thing I can't understand: when I was building the unit options the last time, the type I previously added wasn't there on the list! I had to add it again.. How come clearing Library folder can break Bolt like this? I thought custom types are stored in UnitOptions.db?

I can confirm that putting new List<Vector2Int>() into the script fixes the bug.

Hi Lazlo! I removed the Vector2Int from the build options and also from the variables. In the Flow graph I replaced List<Vector2Int> with List<string>. Had to create super units for Vector2 <-> string conversion. It's clumsy, but stable.

Regarding the missing inspector, yes I was annoyed by the lack of it. I wrote a custom property drawer for Vector2Int but it didn't help. But since I knew what I was doing, I wasn't desperate to see the values. Before I got to writing a custom inspector, I stumbled upon this nasty problem and it consumed two days of my life :D 

Since I reorganized the project, I don't have a Vector2Int in the project anymore. If you want I can add this type again and create a dummy variable to see if the error persists.


So removing Vector2Int from the build options and variables "solved" the issue. I am saying this with a lot of regret as I find it one of the most useful types.

Guys, I believe there is a problem with AOT Pre-build tool. The only explanation I see is that it fails to support Vector2Int as a type eligible for generic collections. Trust me, I ran AOT Build more than dozen times.

Another thing is, why the hell the presence of Easy Save 3 in the project (not scene) would crash the game at startup for a broken AOT type? 

This seems weird at least. 

The problem seems to be more complicated than I initially thought.

Removing Easy Save did remove EXC_BAD_ACCESS and the crash, but Bolt was hanging anyway. I found out that the problem might be that I was using a List of Vector2Int as a variable in Bolt. This is the message I got in the XCode console:

Failed to deserialize behaviour.
System.Runtime.Serialization.SerializationException: Deserialization into 'Bolt.Variables' failed. ---> System.InvalidOperationException: Constructor of System.Collections.Generic.List`1[UnityEngine.Vector2Int] threw an exception when creating an instance ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'System.Collections.Generic.List<UnityEngine.Vector2Int>' threw an exception. ---> System.ExecutionEngineException: Attempting to call method 'System.Collections.Generic.List`1[[UnityEngine.Vector2Int, UnityEngine.CoreModule, Version=, Culture=neutral, PublicKeyToken=null]]::.cctor' for which no ahead of time (AOT) code was generated.

This thread seems to be covering very similar issue and I see that you posted there already:

For now Easy Save seems to be a false lead, more like a problem with IL2CPP? I have a massive headache by now.

Thank you for the detailed response. It's all clear to me now :)

Fair enough, let me rephrase:

We have started a new project that will need visual scripting in some parts. It will be developed for at least six months.

1. Would you say it's better to start learning Bolt v2 right away or start with v1 and then migrate?

2. Will there be major / conceptual changes in the architecture?

3. DOTween is going to be used extensively. Is native support of v2 much better than the community addons?

4. Is alpha going to crash Unity around twenty times or day, or just occasionally?

I am grateful for any help :)

Disclaimer: regarding point 2 - I did read the document describing changes in v2, but as someone who never used Bolt, I can't determine whether they are groundbreaking or not. I would like your opinion for that matter ;-)

Hi there! I have two questions:

1) When will Bolt 2 become available as a public release? (rough estimation is ok)

2) Will Bolt 2 be an update to Bolt or a separate product? (I have just bought v1 and would have to pay again soon)

Thank you!