Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Player build error with 'Editor' folders

Discussion in 'Editor & General Support' started by hjohnsen, Sep 17, 2018.

  1. hjohnsen

    hjohnsen

    Joined:
    Feb 4, 2018
    Posts:
    67
    Hi,

    I am using Unity 2018.2.8f1 and I can not build the player. While it's working fine in the editor, a build gives me some errors, the strange thing is that it tries to compile code inside 'Editor' folders, this of course can not work.
    I've removed the incremental compiler but the result is the same.

    upload_2018-9-17_20-54-40.png

    I can not tell what changed in the project, I was able to build it at some point.

    hj.
     
    VladaVlajic likes this.
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,367
    Are you using assembly definition files? They don't respect Editor folders. You need to add Editor asmdefs.
     
    syshex, leni8ec, noobogami and 6 others like this.
  3. hjohnsen

    hjohnsen

    Joined:
    Feb 4, 2018
    Posts:
    67
    Thank you, that was my problem.
    So I added a new assembly definition file in each Editor folder of the project with the 'Editor' target and with the main asmdef as a reference.
    The build is now working.
     
  4. FADEUFPE

    FADEUFPE

    Joined:
    Mar 22, 2018
    Posts:
    1
    Mar
    Mark TestAssemblies checkbox
     
  5. sand_lantern

    sand_lantern

    Joined:
    Sep 15, 2017
    Posts:
    210
    Is there a way to fix this? I have a bunch of third party plugins that don't do this, and now I have to go through all of my imported packages and add these to their stuff manually. Maybe assembly definitions are just worth removing from my project entirely. They seem to just slow things down more.
     
    dan_ginovker likes this.
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,367
    You could use asmrefs,they make things a little easier. It really depends on how you set up the asmdefs as to whether it will be faster or not. You want minimal dependencies and auto reference disabled.
     
    sand_lantern likes this.