Search Issue Tracker

By Design

Votes

1

Found in

2018.2.0a5

2018.3.0b10

Issue ID

1109313

Regression

No

[iOS][IL2CPP] DescriptorValidationException is thrown when using the C# Protobuf library and compiling the Code

IL2CPP

-

To reproduce:

1. Download attached project “2018.3.0b10.zip" and open in Unity
2. Open “SampleScene” scene
3. Enter Play mode and observe that Console prints two Logs:

Message:
UnityEngine.Debug:Log(Object)
Test:Start() (at Assets/Test.cs:17)

{ "code": "PIT-000", "msg": "GetError is returning a custom error" }
UnityEngine.Debug:Log(Object)
Test:Start() (at Assets/Test.cs:18)

4. Exit Play mode
5. Build for iOS
6. Deploy the Xcode project to iOS Device
7. Observe that DescriptorValidationException is thrown in Console

Notes:
- This issue does not appear on Windows and macOS Standalone (IL2CPP)
- Could not check on Unity 2018.1 and earlier than 2018.2.0a5 because project becomes corrupted

Tested with:
- iPhone 7s Plus, iOS: 12.0 - Reproduced
- iPhone X, iOS: 11.3.1 - Reproduced

Reproduced on Unity 2018.2.0a5, 2018.2.20f1, 2018.3.1f1 and 2019.1.0a13

  1. Resolution Note:

    The problem here is that part of the Google.Protobuf.dll assembly which is used only via reflection is removed by the Unity managed bytecode stripping process. For IL2CPP, Unity always enables managed bytecode stripping, so you will need to indicate that the Google.Protobuf.dll assembly should not be modified.

    This is possible by placing a link.xml file in the Assets/ folder of the project with the following content:

    <linker>
    <assembly fullname="Google.Protobuf" preserve="all"/>
    </linker>

    You can find out more information about the link.xml file here: https://docs.unity3d.com/Manual/IL2CPP-BytecodeStripping.html

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.