Search Unity

Help Wanted Error when building: System.BadImageFormatException: Could not resolve field token 0x04000025

Discussion in 'Editor & General Support' started by SLGSimon, Jul 20, 2021.

  1. SLGSimon

    SLGSimon

    Joined:
    Jul 23, 2019
    Posts:
    70
    I am randomly getting this error in automated builds (2020.3.11f1):

    (0,0): error System.BadImageFormatException: Could not resolve field token 0x04000025, due to: Could not load type of field 'Unity.Properties.CodeGen.Utility:s_AssemblyDefinedTypesQualifiedWithAttributes' (0) due to: Could not load file or assembly 'Unity.Properties, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:Unity.Properties, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:(null) signature:<none> assembly:D:\jenkins_agent\workspace\Eco Test Pipeline (develop)\Client\Library\ScriptAssemblies\Unity.Properties.CodeGen.dll type:Utility member:(null) signature:<none>

    I tried deleting the `Client\Library\ScriptAssemblies` folder before the build but that hasn't helped.

    Any ideas on what might be causing it or how to narrow it down?
     
    Last edited: Aug 4, 2021
    TJNBG likes this.
  2. TJNBG

    TJNBG

    Joined:
    Apr 7, 2021
    Posts:
    1
    Seems to be a regression. 2020.3.8f1 does not exhibit this problem, however later builds do (checked 2020.3.14f1 and 2020.3.15f2)
     
  3. chechoggomez

    chechoggomez

    Unity Technologies

    Joined:
    Feb 25, 2013
    Posts:
    90
    Hi SLGSimon and TJNBG, do you have a reproduction project for this? Does it reproduce consistently? We have been looking for a project to reproduce it consistently for a while, but we haven't found anything yet.
    We are not sure what is causing it and that's why we are looking for reproduction projects.
     
  4. SLGSimon

    SLGSimon

    Joined:
    Jul 23, 2019
    Posts:
    70
    It seems pretty random, I am not able to repro it. We have many builds happening on two build machines. I could save the entire workspace after it happens but it's like 100GB all up. Would be happy to get you access to our project if it will help.
     
  5. cimrellik

    cimrellik

    Joined:
    Jul 1, 2020
    Posts:
    3
    I'm having the exact same issue, also on Jenkins using 2020.3.17f1. It's also happening very randomly, and doing the build with the exact same project state again usually works.
     
unityunity