0
Fixed

[Error] Could not find generated class for PlayerController (ClassDefinition). and [CompilerError] Identifier expected

Ex-Crow 12 months ago updated by Lazlo Bonin (Lead Developer) 10 months ago 4

This appeared after several repeated clicks on generate scripts button and then trying to run Play in generated mode. 

Graph: https://imgur.com/JNyAkFm

[Error] Could not find generated class for PlayerController (ClassDefinition).
System.Runtime.Serialization.SerializationException: Unable to find type: 'Ludiq.Bolt.Generated..Player.PlayerController'.
  at Ludiq.RuntimeCodebase.DeserializeType (System.String typeName) [0x00011] in C:\GameDev\Bolt2a6\Assets\Ludiq\Ludiq.Core\Runtime\Reflection\RuntimeCodebase.cs:150 
  at Ludiq.Bolt.ClassHost.GetGeneratedClassInstantiator (System.String generatedTypeName) [0x00027] in C:\GameDev\Bolt2a6\Assets\Ludiq\Bolt.Core\Runtime\Architecture\ClassHost.cs:896 
  at Ludiq.Bolt.ClassHost.InstantiateGenerated () [0x00093] in C:\GameDev\Bolt2a6\Assets\Ludiq\Bolt.Core\Runtime\Architecture\ClassHost.cs:406 
ClassHost.InstantiateGenerated()    Assets/Ludiq/Bolt.Core/Runtime/Architecture/ClassHost.cs:410
408:   catch (Exception ex)
409:   {
-->410:       Debug.LogError($"Could not find generated class for {definition}.\n{ex}");
411:       return false;
412:   }

ClassHost.Instantiate()    Assets/Ludiq/Bolt.Core/Runtime/Architecture/ClassHost.cs:246
244:   else if (requestedRuntimeMode == GlobalRuntimeMode.Generated)
245:   {
-->246:       instantiated = InstantiateGenerated();
248:       if (instantiated)

ClassHost.Initialize()    Assets/Ludiq/Bolt.Core/Runtime/Architecture/ClassHost.cs:213
211:   {
212:       instance.data.isAlive = true;
-->213:       Instantiate();
214:   }

UnityClassHost.Awake()    Assets/Ludiq/Bolt.Core/Runtime/Architecture/UnityClassHost.cs:11
9:   public void Awake()
10:   {
-->11:       Initialize();
12:   }

ClassComponent.Awake()    Assets/Ludiq/Bolt.Core/Runtime/Architecture/ClassComponent.cs:72
70:   private void Awake()
71:   {
-->72:       host.Awake();
73:   }

A different error after exiting Play mode:

[CompilerError] Identifier expected
Compiler Error at Assets\Ludiq.Generated\Transient\Scripts\PlayerController.cs:29 column 32
27:   using UnityEngine;
-->29:   namespace Ludiq.Bolt.Generated..Player
30:   {
31:       public class PlayerController : GeneratedComponent

Bolt Version:
2.0.0a6
Unity Version:
2019.2.15
Platform(s):
PC
Scripting Backend:
Mono
.NET Version (API Compatibility Level):
.NET 4.x
Bolt 2

Uncommenting

#define DEBUG_CLASS_HOST

fixed it

Fixed (Unreleased)

Hi TowerCrow,

Thanks for the report. This will be fixed in the next version.