Repository: godot
Issue: Android build is (sometimes) missing referenced .NET assemblies
Labels: bug,platform:android,topic:porting,topic:dotnet

**Godot version:**
3.2.1
(3.2.2 has some breaking changes so I have not updated yet)

**OS/device including version:**
Ubuntu 20.04 LTS
Linux devtop-home 5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Multiple version of Android

**Issue description:**
In my project reference some nuget packages, for example:

protobuf-net
netmq
Newtonsoft.Json

**Steps to reproduce:**
Create an empty project with C# support.
Add said nuget packages, export the APK

**Minimal reproduction project:**

The project I attached actually works... (but so does my other project sometimes)
If you open the APK you can see protobuf-net is there, whereas in my other apk it is not.

[AssemblyIssueSample.zip](https://github.com/godotengine/godot/files/4889294/AssemblyIssueSample.zip)

![image](https://user-images.githubusercontent.com/2060470/86894206-57483980-c135-11ea-8b3a-670de3b32be1.png)

If you look at the screenshot, you will see the content of 2 APK files. One does not include the protobuf-net assembly.
I do not know what triggers the issue.

Logcat:

```
8 15:42:13.246  5553  5588 E mono    : Unhandled Exception:
07-08 15:42:13.246  5553  5588 E mono    : System.IO.FileNotFoundException: Could not load file or assembly 'protobuf-net, Version=2.4.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67' or one of its dependencies.
07-08 15:42:13.246  5553  5588 E mono    : File name: 'protobuf-net, Version=2.4.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67'
07-08 15:42:13.246  5553  5588 E mono    :   at (wrapper managed-to-native) System.MonoCustomAttrs.IsDefinedInternal(System.Reflection.ICustomAttributeProvider,System.Type)
07-08 15:42:13.246  5553  5588 E mono    :   at System.MonoCustomAttrs.IsDefined (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00027] in <d27d4d20107845ca9569511318b19517>:0 
07-08 15:42:13.246  5553  5588 E mono    :   at System.RuntimeType.IsDefined (System.Type attributeType, System.Boolean inherit) [0x00038] in <d27d4d20107845ca9569511318b19517>:0 
07-08 15:42:13.246  5553  5588 E mono    :   at System.Enum.InternalFormat (System.RuntimeType eT, System.Object value) [0x00000] in <d27d4d20107845ca9569511318b19517>:0 
07-08 15:42:13.246  5553  5588 E mono    :   at System.Enum.ToString () [0x00011] in <d27d4d20107845ca9569511318b19517>:0 
07-08 15:42:13.246  5553  5588 E mono    :   at DebugLabel._Process (System.Single delta) [0x0000d] in <dac6cfdc1ab24ae5b528571459958f73>:0 
07-08 15:49:17.312  6303  6343 I godot   : Godot Engine v3.2.1.stable.mono.official - https://godotengine.org
07-08 15:49:17.474  6303  6343 I godot   : Mono: Logfile is: /data/data/com.sample.mygame/files/mono/mono_logs/2020_07_08 15.49.17 (6303).txt
07-08 15:49:17.630  6303  6343 E godot   :    At: modules/mono/csharp_script.cpp:3187:reload() - Condition "!obj_type" is true. Returned: ERR_BUG
07-08 15:49:17.666  6303  6343 E godot   :    At: modules/mono/csharp_script.cpp:2915:can_instance() - Method failed. Returning: __null
07-08 15:49:18.130  6303  6343 E mono    : 
07-08 15:49:18.130  6303  6343 E mono    : Unhandled Exception:
07-08 15:49:18.130  6303  6343 E mono    : System.IO.FileNotFoundException: Could not load file or assembly 'protobuf-net, Version=2.4.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67' or one of its dependencies.
07-08 15:49:18.130  6303  6343 E mono    : File name: 'protobuf-net, Version=2.4.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67'
07-08 15:49:18.130  6303  6343 E mono    :   at (wrapper managed-to-native) System.MonoCustomAttrs.IsDefinedInternal(System.Reflection.ICustomAttributeProvider,System.Type)
07-08 15:49:18.130  6303  6343 E mono    :   at System.MonoCustomAttrs.IsDefined (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00027] in <d27d4d20107845ca9569511318b19517>:0 
07-08 15:49:18.130  6303  6343 E mono    :   at System.RuntimeType.IsDefined (System.Type attributeType, System.Boolean inherit) [0x00038] in <d27d4d20107845ca9569511318b19517>:0 
07-08 15:49:18.130  6303  6343 E mono    :   at System.Enum.InternalFormat (System.RuntimeType eT, System.Object value) [0x00000] in <d27d4d20107845ca9569511318b19517>:0 
07-08 15:49:18.130  6303  6343 E mono    :   at System.Enum.ToString () [0x00011] in <d27d4d20107845ca9569511318b19517>:0 
07-08 15:49:18.130  6303  6343 E mono    :   at DebugLabel._Process (System.Single delta) [0x0000d] in <1c508adea2bd49df979fb8fbfb68771a>:0 
```

I think if something goes wrong during the export process it stops adding assemblies
but still produces the APK.