IL2CPP error during compiling libraries for Android Apk

Issue #673 resolved
Vitalii Dudnyk created an issue
  1. A bug during creating a build.
  2. This bug is always reproduced while I try to create a build for Android, it seems to me that it doesn’t depend on Unity build settings. I use AOT Generation to serialize and avoid stripping classes.

The build process is interrupted during IL2CPP compilation, and Unity outs logs, the first, and I think important is:

IL2CPP error for method 'System.Void Sirenix.Serialization.AOTGenerated.PreventCodeStrippingViaReferences::.cctor()' in assembly 'C:\Projects\Nanoreality\Nanoreality\NanoReality\Temp\StagingArea\assets\bin\Data\Managed\Sirenix.Serialization.AOTGenerated.dll'
Additional information: Exception has been thrown by the target of an invocation.

The bug appeared after I added a new script. I attached the script to the issue

It seems to me that I don't add appropriate attributes inside this script, however, I checked the documentation and I haven’t found a solution. Moreover, the unity error log brings little information, that’s why I can’t reveal the problem.

4. Unity version is 2109.2.21f1

5. The version of Sirenix is 2.0.20, however, I caught the bug with 2.1.12 version.

6. NO

7. Windows

Comments (6)

  1. Tor Esa Vestergaard

    It looks like a type that support has been generated for is missing at compile time - specifically, LoggingSettings.LoggingUnitConfig, which is cut out by the #if UNITY_EDITOR preprocessor directive. If you move that type out of the #if, things should work fine.

  2. Tor Esa Vestergaard

    Alternatively you could also toggle support for that particular type off in the AOT support list.

  3. Log in to comment