[SOLVED] Visual script/ localization system not working in android build for Quest2

I have a problem with the Localization System, consisting in that in the editor everything works fine, but once I make a build and install it on my Quest 2, I get the following error (debugging with logcat):

2022/09/16 12:57:04.743 1450 1494 Error Unity ExecutionEngineException: Attempting to call method ‘Unity.VisualScripting.StaticFunctionInvoker`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[UnityEngine.Localization.Tables.TableReference, Unity.Localization, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::.ctor’ for which no ahead of time (AOT) code was generated.

…and also these:

2022/09/16 12:57:04.743 1450 1494 Error Unity at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[ ] parameters, System.Boolean wrapExceptions) [0x00000] in <00000000000000000000000000000000>:0

2022/09/16 12:57:04.743 1450 1494 Error Unity at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[ ] args, System.Globalization.CultureInfo culture, System.Object[ ] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0

2022/09/16 12:57:04.743 1450 1494 Error Unity at System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, Sys

My application consists of a visual script, that has several types of dialogue/pop-up boxes which I’m using for a dialogue system. Those have a bunch of TMP text in them which is localized. You can see my dialogue system canvas on the right (scene.png) and a bunch of buttons and text I added to the left in attempt to debug. Most importantly, one of the two debug texts at the bottom is localized and but as visible, it still only shows the default “localized text” string, which I did in order to have something that is not attached to the Visual script and see if the issue still occurs (see localized_debug_text.png and localized_debug_text_table.png).

Things I have tried so far:

  • Rebuild addressables (both clean and default build)
  • Change the Bundle naming mode to Append Hash to File name
  • Wait for next frame before spawning dialogue boxes
  • Tried to change default locale to a different language
  • Tried changing LS package version (both upgrading manually through the manifest and downgrading to the next available version in the package manager)

Unity version: 2021.2.14f1
Localization System package version: 1.3.2
I’m attaching an image of how my addressables look atm.

Any help will be super appreciated as the situation is a bit urgent and I can provide extra info if needed!

8444165--1119470--localized_debug_text.png



Can you share the full log file?
Are you sure this is an addressable/localization issue? This error seems to imply its something to do with visual scripting.

Yes. Since I’m getting the error only when running natively on the Quest2, would the log from %LOCALAPPDATA%\Unity\Editor\Editor.log suffice? Should I run the application in the editor or the headset before sampling the log?

The log from the quest with the error message should be fine

Here’s the logcat sampled after running the application on the Quest2. Sorry for the delay

8444447–1119542–logcat.txt (138 KB)

What version of visual scripting are you using? Can you try the latest 1.7.6 or newer?
Alternatively, you can try to have a link.xml to include the missing API so that this will be preserved

Hi Karl, I’m actually on version 1.7.8 for the visual script. I will try to change to some other one and make a build with that. Could you elaborate a little on your suggestion about including the missing API, I’m not entirely sure what you mean there. Also, an update: In my original post I say that the localized text I made for debugging doesn’t work, but it actually does. This was a mistake on my part, where I forgot to set the Update String on the Localize String Event to point at the correct text object (you can even see it in the localized_debug_text.png that I uploaded). This leads me to believe, that the issue is not with the localization system, but with the visual script being exported as an apk.

You can use a link.xml file to prevent code from being stripped. This may solve the issue.

Update: Trying to prevent the visual script/localization elements from being stripped with the xml file fix did not seem to work, but I found a solution by changing the IL2CPP Code Generation from “Faster runtime” to “Faster (smaller) builds”. All VS nodes work now in the build and the UI is visible.

1 Like

Ah great. Could you please file a bug report for the original issue so we can get it fixed?

Yes, I’ll do that later today/in the upcoming days

1 Like