Search Unity

Build and run failure

Discussion in 'Windows' started by carlosctcl, Sep 23, 2021.

  1. carlosctcl

    carlosctcl

    Joined:
    Sep 6, 2020
    Posts:
    20
    Hi!
    I'm trying to build and run my project and im getting this errors in console:
    Code (CSharp):
    1. An asset is marked with HideFlags.DontSave but is included in the build:
    2. Asset: 'Library/unity editor resources'
    3. Asset name: slider thumb focus@2x
    4. (You are probably referencing internal Unity data in your build.)
    5. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
    6.  
    Code (CSharp):
    1. Building - Failed to write file: sharedassets0.assets
    2. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
    Code (CSharp):
    1. Build completed with a result of 'Failed' in 16 seconds (15822 ms)
    2. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
    Code (CSharp):
    1. UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
    2.   at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <dc14d30a5e0540ee9311ed6df63d9074>:0
    3.   at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <dc14d30a5e0540ee9311ed6df63d9074>:0
    4. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
    Searching in forums i've tried without success:
    1. Search for using.UnityEditor in any script
    2. Rename "Resources" folders
    3. Try with a new scene
    4. Delete Library folder
    5. Make sure the project folder is not as "read only" in properties.

    I dont know how continues to solve this issue... please help!
     
  2. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    332
    The first error is the main source of the issue, it's basically saying that an asset named "slider thumb focus@2x" (which I believe is a texture) is being referenced by "sharedassets0.assets" at build time, which is a horribly unfriendly way of saying "The scene at index 0 in your Build Window".

    So open that scene and look at anything referencing textures to find the usage of that texture and remove it. That will fix the build error.
     
    carlosctcl likes this.
  3. carlosctcl

    carlosctcl

    Joined:
    Sep 6, 2020
    Posts:
    20
    Thanks a lot!
    I've been trying deleting each gameobject in the scene and finally one slot in canvas has any pproblem and after delete it and create it again, the project build and runs well.

    Now i've crashes when i open the canvas, but that is other history... :)
    Thanks a lot