[SOLVED] Initialization Error. Verify if the class 'Bolt.BoltDynamicData' exists on your build and

psychogears
edited December 2019 in Photon Bolt

Good evening. I'm running into a problem when launching a built game. Bolt seems to connect to the cloud just fine when run from within the Unity Editor, but when I build and try to run in the standalone player nothing seems to happen past Bolt.StartServer() and Bolt.StartClient(). BoltStartDone() never seems to get called.

I was poking around looking for where the standalone player might log stuff and I came upon Player.log, with this line near the end:

"Initialization Error. Verify if the class 'Bolt.BoltDynamicData' exists on your build and it was not stripped."

I don't know how to verify if the class was not stripped.

Help appreciated. Thanks.

-TJ

Comments

  • The rest of the Player.log file for reference.

  • Hello @psychogears ,


    Which Bolt SDK version are you using? Are you building using il2cpp ?

    Please, this issue was fixed on a recent version of the SDK, so you should always update.

    For a quick fix you should include the attribute 'Preserve' to the Bolt.BoltDynamicData class.

  • I'm just using whatever is on the unity asset store. I'm pretty new to unity and C# so if there's something I need to do outside of the bolt wizard to get up and running, please let me know. I was able to build the tutorial so I didn't think I had to do anything else.

  • psychogears
    edited December 2019

    If it helps, this is my bolt settings.

  • I just checked BoltDynamicData.cs, and it looks like the class already has the 'Preserve' attribute on it.

    namespace Bolt

    {

    [Preserve]

    public static class BoltDynamicData

    {

    ...

  • I went back and googled "unity class stripped" and found that Unity does something related to these words. In "Project Settings", "Player", "Other Settings", "Optimization" section, there's a "Managed Stripping Level" that was set to Medium for me. I tried setting it to Low and built the game again, and now it's progressing past the point of StartServer().

    Thanks for your help.