Search Issue Tracker

Fixed in 2020.2.X

Fixed in 2020.1.X

Votes

0

Found in

2020.1.0b2

2020.1.0b14

2020.2.0a3

Issue ID

1263916

Regression

Yes

[IL2CPP] Managed Code Stripping strips a parameterless constructor from a managed dll when using IL2CPP Scripting Backend

IL2CPP

-

Reproduction steps:
1. Open the attached "1263916 repro" project
2. Open Build Settings from File > Build Settings
3. Make sure that "Development Build" is checked
4. Build and Run the project

Expected result: no error is thrown and the "double_this_int" method returns 26
Actual result: MissingMethodException is thrown

Reproducible with: 2020.1.0b2, 2020.1.1f1, 2020.2.0a3, 2020.2.0a19
Not reproducible with: 2018.4.25f1, 2019.4.5f1, 2020.1.0b1, 2020.2.0a2

Notes:
-This doesn't reproduce with any Managed Stripping level on Mono Scripting Backend
-The 3rd step isn't mandatory and doesn't affect the outcome, it's there only to illustrate the issue more easily
-The full error is:
MissingMethodException: A parameterless constructor is required for type 'ManagedPlugin.Helper/Thing'.
at ManagedPlugin.Helper.double_this_int (System.Int32 x) [0x00000] in <00000000000000000000000000000000>:0
at Test.Start () [0x00000] in <00000000000000000000000000000000>:0

  1. Resolution Note (fix version 2020.2):

    Fixed in 2020.2.0b2

  2. Resolution Note (fix version 2020.1):

    Fixed in 2020.1.11f1

Add comment

Log in to post comment