+2
Cannot Reproduce

Application Variable not found in iOS

Youngmin Kim 3 months ago updated by Lazlo Bonin (Lead Developer) 6 days ago 8

Application variable does not work normally.

These variables are imported normally in the editor, but with a "Variable not found: 'xxx'" error in iOS builds.

I registered these in App Variables and called them from c # Script.

Variables.Application.Get <StageData> ("xxx");

Can you give me some advice about this bug?

Bolt Version:
1.4.10
Unity Version:
2019.2.17f
Platform(s):
iOS
Scripting Backend:
IL2CPP
.NET Version (API Compatibility Level):
.NET 4.x

@Youngmin Kim did you do an AOT prebuild before trying to access that variable with code?

Yes. I run both "Unit Build Options" and "AOT Prebuild ..." before building.

I found the same problem with Object Variables.

And occur corrupted graph variables...

You should share the script that's getting corrupted here as well. Dev won't be able to guess what it contains.

EDIT: Take note that renaming things in the script will break existing connections between units in graphs. 

I tested by below code:

        DonutsPop.StageData stageData = Variables.Application.Get<donutspop.stagedata>("SO_Stages");
        if (stageData != null)
        {
            Debug.Log("Success loaded from Application Variable");
        }
        else
        {
            Debug.Log("Failed loaded from Application Variable");
        }

For now, I moving all graphs to code.

Need More Information

Hi Youngmin Kim,

I would need project files and/how clear reproduction steps from a blank project in order to be able to help you.

This is the first time I hear of this issue specifically, so there might be something weird in your build setup.

Do you also lose app variables on a blank project with only Bolt?

Cannot Reproduce

Hi Youngmin Kim,

I'm closing this thread as Cannot Reproduce seeing as we have not heard back with reproduction steps in the last two months. I'm assuming you somehow found the cause of the issue on your end. If you have any more information, feel free to comment again.