C# scripts work in editor but fail completely when exporting to platforms

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

I have a test project set up in C#. The main scene comprises a simple Button and a TextEdit node. The main script includes a few external C# libraries, which were added in Visual Studio Code via references, but otherwise the script is responsible only for changing the text in the TextEdit field. When played through the editor, everything goes without a hitch, but when I try to export to Android, I get the following alert message: “Failed to export C# project
Missing BCL (Base Class Library) for platform: android”.

I think I have set up the Android export template correctly; I set up Android Studio, pointed to the SDK folder, used a keystore and pointed to the right android template paths (android_debug.apk, android_release.apk). In fact, I can export the project successfully, so long as I only include gdscript code. All my C# code seems to be ignored completely. Long story short, C# cannot be exported.

To make matters worse, I tried exporting to Windows as well, but I had no luck there either. The problem remains: gdscript is exported properly, C# fails. I am using Godot 3.5.1 and I also tested 3.4.2, but to no avail. Finally, I tried to export a simple C# script that does not reference any external libraries, but it still failed. Has anyone had any experience/issues with C# exports? What am I missing?

:bust_in_silhouette: Reply From: Aboud

Hi there,
I found the problem, I’ve had the same error (“Missing BCL… Android”).

Export templates were not correctly installed, despite Godot saying “Export templates are installed and ready to use”.

Solution :
Install Export templates again, you might encounter a writing error that needs permission, start Godot with Administrative privilege and install again.