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.
  2. Dismiss Notice

Files are duplicating uncontrollably.

Discussion in 'Editor & General Support' started by gtzpower, Jan 6, 2020.

  1. gtzpower

    gtzpower

    Joined:
    Jan 23, 2011
    Posts:
    318
    Anyone experienced issues with randomly duplicating files in the assets folder? This has happened on the last 3 versions I have used (all 2019.2.x, currently on 2019.2.17). Usually the files being duplicated are were related to the Google Play games services plugin. I haven't had problems with it for a couple weeks now as i was working on an iOS build, but I switched over to Android as a target, and after a failed build (missing keystore), I have 1700+ duplicate files all with a 2 in the name, this time, not including the Google play game services plugin, so I am not sure what is causing it. It seems to be a random selection of files this time around.

    Right after the build failed, I got an "importing" progress bar and 999+ errors about how namespace <namespace> already contains a definition for <class>. Any ideas on how I can stop this madness? It seems to be related to android plugins/builds.
     
  2. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    536
    same here
     
  3. gtzpower

    gtzpower

    Joined:
    Jan 23, 2011
    Posts:
    318
    I have no idea what is causing it, but it is still happening. I am just relying on SourceTree to filter newly added files and manually going through them to see if there are any that I actually wanted to keep. Glad, but also sorry to hear, that I am not the only one.
     
  4. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    Does Unity pause when creating the new files? Usually, duplicating a file causes a pause in Unity while it imports the file. You could try enabling the profiler and waiting for one of those pauses, and then look at the lag spike. It might get you a stack trace, or something to help you find the culprit.
     
  5. gtzpower

    gtzpower

    Joined:
    Jan 23, 2011
    Posts:
    318
    Thanks for the suggestion. It only happens like once every week or two for me, but I can try leaving the profiler open to see if I can catch it. The last time it happened to me was after an Android build finished, when I clicked back onto Unity, it started importing new files. I'll be lucky to catch it in the profiler, but will try.
     
  6. Ghosthowl

    Ghosthowl

    Joined:
    Feb 2, 2014
    Posts:
    228
    I have had this issue not with files, but gameobjects and scripts. I can't pin down what is causing it.
     
  7. gtzpower

    gtzpower

    Joined:
    Jan 23, 2011
    Posts:
    318
    That's interesting. Makes me wonder if it has something to do with what window had focus (hierarchy vs project window). Are you referring to components on game objects when you say "scripts" or are you referring to the scripts in the "Project" window?
     
  8. Ghosthowl

    Ghosthowl

    Joined:
    Feb 2, 2014
    Posts:
    228
    Sorry, I should have clarified. I mean the components on gameobjects.

    At first I thought it was caused by Version Control. I don't remember, but I think it first happened to me after opening Unity again after committing an update. I am using Unity Collaborate and Plastic SCM. But after re-reading your posts, I am also using a project targeting Android (and iOS).
     
  9. dansav

    dansav

    Joined:
    Sep 22, 2005
    Posts:
    499
    Unity 2022.1 having this issue on webgl clean builds it's creating a huge mess and it's doing this on packages creating 2 copies of them which conflict. How do you turn this off!
     
  10. dansav

    dansav

    Joined:
    Sep 22, 2005
    Posts:
    499
    Turns out it was an icloud sync problem not a unity problem. icloud was rewriting files for some weird reason. I have moved unity off the desktop and into a safe folder where icloud cannot touch it.