Can't generate mono glue on Android

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Orest-2

Hello, I’ve been trying to manually compile the master branch for the Godot engine to directly generate an executable, but I’m having trouble when trying to generate an executable supporting the mono environment.

I have tried following the guide in the docs, but I can’t get pass the Generate the Glue part. Whenever I run the command:

scons p=android target=release_debug tools=yes module_mono_enabled=yes mono_glue=no

I get the following output:

scons: Reading SConscript files ...
Building for Android (armv7) (with NEON)
Using NDK unified headers
"pkg-config" ­Ґ пў«пҐвбп ў­гв७­Ґ© Ё«Ё ў­Ґи­Ґ©
Є®¬ ­¤®©, ЁбЇ®«­пҐ¬®© Їа®Ја ¬¬®© Ё«Ё Ї ЄҐв­л¬ д ©«®¬.
OSError: 'pkg-config monosgen-2 --cflags --libs' exited 1:
  File "D:\GoDotProject\godot\SConstruct", line 402:
    config.configure(env)
  File "./modules/mono\config.py", line 160:
    env.ParseConfig('pkg-config monosgen-2 --cflags --libs')
  File "C:\Program Files (x86)\Python36-32\Lib\site-packages\scons-3.0.0\SCons\Environment.py", line 1557:
    return function(self, self.backtick(command))
  File "C:\Program Files (x86)\Python36-32\Lib\site-packages\scons-3.0.0\SCons\Environment.py", line 594:
    raise OSError("'%s' exited %d" % (command, status))
:bust_in_silhouette: Reply From: Ben Beshara

I think this issue may be similar to one I had compiling with Mono for Mac on OSX - https://forum.godotengine.org/21875/cant-generate-mono-glue-on-osx

You need to make sure that the script is passing the OS environment variables to the Python script - so in your case I think you would write env = Environment(ENV = os.environ) right above env.ParseConfig('pkg-config monosgen-2 --libs-only-L') or something similar.

I don’t have a windows computer set up to compile Godot for Android so this is only a guess but I hth - good luck!