Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Official IL2CPP Build Time Improvements - Seeking Feedback

Discussion in '2021.2 Beta' started by joncham, Feb 24, 2021.

  1. pradotech

    pradotech

    Joined:
    Oct 17, 2019
    Posts:
    35
    I could build for Android using Master compiler after changing Stripping Level to Medium (I was using Low) and switching from .NET Framework to .NET Standard 2.1. Details below:

    •Unity 2021.3.9f1
    •Faster runtime
    •Compression: LZ4HC
    •API Compatibility: .NET Standard 2.1
    •Compiler Configuration: Master
    •All architectures (ARMv7, ARM64, x86 and x86-64)
    •Managed Stripping Level: Medium/High
    •I also removed some unused scripts from project.

    Build completed without any errors.

    Hope it keeps working and maybe that helps someone.
     
    Chibi_Phoenix likes this.
  2. Elapotp

    Elapotp

    Joined:
    May 14, 2014
    Posts:
    98
    Thank you, @pradotech .

    Any differences with other levels and compiler settings (like apk/abb size, on device performance)?
    Can't test myself on Unity 2021.3.9f1, cause there is a crash on launch
     
  3. pradotech

    pradotech

    Joined:
    Oct 17, 2019
    Posts:
    35
    I didn't try other settings after I found this working one, but I'm almost certain that the managed stripping level on low is the main reason for the build errors.
     
  4. Chibi_Phoenix

    Chibi_Phoenix

    Joined:
    Nov 12, 2019
    Posts:
    4
    OMG THANK YOU SO MUCH!!!
    This was driving me crazy for the past week... suddenly my project couldn't be build anymore, but this does seem to work!
     
  5. PoweredOnSoftware

    PoweredOnSoftware

    Joined:
    Apr 10, 2015
    Posts:
    7
    hello i'm having an issue with Generics & IL2CPP with Unity 2021.3.11f1

    i'm trying to use YoutubeExplode which depends on System.Text.Json

    https://www.nuget.org/packages/YoutubeExplode/6.2.5#dependencies-body-tab

    but i keep getting errors related to missing methods when use IL2CPP (both .NET standard 2.1 and .NET framework paths)

    https://github.com/Tyrrrz/YoutubeExplode/discussions/679#discussioncomment-4639222

    i tried adding a link.xml, and disabling Strip Engine Code, and low / disabled stripping levels, to no avail

    NOTE: when i switch to Mono scripting backend, it works. But then I can't target ARM64 / v8a :(

    which means i can't publish to google play https://i.imgur.com/BoBXowU.png

    any suggestions or guidance would be greatly appreciated

    ---

    **UPDATE**


    derp, i was still on unity 2021

    i've upgraded to Unity 2022, to take advantage of Full Generic Sharing,

    but now I have a new error:

    1. K:\Code\Nreal-Unity-Demos\Android\unityLibrary\src\main\Il2CppOutputProject\Source\il2cppOutput\System.Text.Json3.cpp(11890,11): error: no viable overloaded '='
    2. V_3 = L_12;
    3. ~~~ ^ ~~~~


    Full build output:

    https://gist.github.com/jakedowns/4e1462e6b877d348539cc4d20fead3e5
     
    Last edited: Jan 11, 2023
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,566
    This error usually means there are two competing implementations of System.Threading.Tasks.ValueTask in your project. Is there a System.Threading.Tasks.Extensions.dll somewhere? If so, you can remove it, because the it is already implemented in the .NET base class library that ships with Unity.