Why are my assets being reimported endlessly? [Solved]

There’s been a few threads on this and zero suitable solutions.

When I alt-tab away from my Unity project and then tab back to it, Unity declares that ‘the scene has been modified on disk’ and that I can choose to reload it.
Every time, without fail.

Worst still, in projects with many assets, it will import them. Then reimport them. Then reimport them. Checking the files in explorer reveals no changes.

What could be the interference?
I’ve disabled Windows Defender, tried closing any revisioning systems and reinstalled Unity3D. There must be a direct cause.

(Using Windows 8)

PostScript: The problem vanished overnight. Sorry to anyone else who has the same problem in the future, there may be clues in this thread and comments.

PostScript 2: The problem resurfaced after a number of weeks. Going to attempt to reformat and reinstall. Sigh.

PostScript 3: Solved it. My project was on a partition which is formatted as UDF. I moved the project files to an NTFS partition and the problem vanished.

you're saying just CHANGING APPS triggers this?? Holy hell ! Do you have ANOTHER windows8 computer, you can try this on? Recall you can use your license on two computers.

–

not a bad thought, though it is not a very satisfying answer. Some computers just simply don't agree with unity

–

This is the only Windows 8 computer i've had this problem on. Additionally I have had Unity3D installed on this same computer before with no trouble.

–

silly but -- is there simply some sort of Virus on the computer? is it hard to do a fresh install of "Windows 8" ? (or, would that even kill any viruses? in some sense can you be "absolutely certain" you have no viruses?) if it was an everyday unix box you could look at the processes running, can you do something like that?

–

The files remain intact, the timestamp doesn't change between refreshes and it's extremely unlikely that there's a virus tailored to tampering with Unity3D in this way. I'm ruling it out for those reasons. Reformatting is not a solution.

–

7 Answers

7

Have you tried turning on Meta files? In Edit>Project Settings>Editor and switch version control to Meta Files…

As I use Git revisioning systems extensively, enabling Meta files is one of the first things I do when making a Unity3D project. It's neither the cause nor the solution, so far.

–

So writability of the AssetDatabase files in Library? That file being locked could cause a problem (not that GIT locks files) - something wrong with the metadata folder in library? How much of your project is under GIT control? Just Assets? GIT and Unity have been a nightmare for me on Mac (mainly because MonoDevelop has developed a nasty habit of parsing things for many minutes every time you open a project) and I've switched to Asset Server (which would probably also solve your problem if you used Asset Cache Server).

–

I occasionally get errors like "AssetImporter is referencing an asset from the previous import. This should not happen." and "AssetImporter has crashed". The actual AssetDatabase file vanishes, reappears and is modified regularly when the problem occurs. My entire project is under GIT, with exclusion rules. I've had little to no trouble with it in several months of usage. An asset server costs money, so I can't consider that a solution.

–

can you simply turn off GIT use, and see if that is the problem? 1 - is it difficult to turn off GIT ? 2 - What version of Unity ? 3 - does this happen with EVERY PROJECT? Can you start a new trivial Unity project (not using git) and see if it happens with that? 4 - simply the location where you have your Unity project (the problem one). Cjhange it. Drag it to the desktop, stick it in a folder. Put it on a different physical drive (USB stick) or partition. Any change?

–

I've uninstalled GitExtensions and rebooted, problem persists. 4.0.7 Yes, it's since happened with every project I've opened on this computer, including one I just created for testing purposes. The location doesn't seem to matter.

–

If you’re working with git, remember that it doesn’t track empty folders. If you’re working with meta files, you can see those .meta files being deleted and added continuously because someone is tracking an empty folder that actually doesn’t exists for git (so Unity will automatically delete those .meta).

Disable git plug-in in MonoDevelop. It’s a pain in the ass, and it’s most of the time the responsable of those slow file loads (5 minutes waiting to open a new .cs you’ve created on Unity? no more pls…). This most probably won’t help solving the main problem, but will make your life easier. I work via command line and I’m very satisfied (however, git for windows is somehow nasty). There some git GUIs out there for Windows too.

If you’re using text-mode serialization (YAML format), lots of assets can get re-serialized (same content, different object distribution inside the file).

Mecanim serialized FSMs (.controller) get reserialized quite often in our project with no reason. Also terrains show modified, and even scenes that we haven’t touched but Unity says they’re modified. I’m quite sure this is most of the time because of third-party libraries that somehow doesn’t handle hideFlags and some other serialization stuff that well. Other times, it seems it’s a Unity bug that causes this re-serialization to be performed.

Also permissions were a problem for us in a Windows 7 machine.

I’ve been working extensively with git in a personal project for quite some time (no third-party libs), and it’s a pleasure (I’m working with lots of branches, rebasing and merging big time. No problems if I follow the empty-folder rule I’ve stated before).

Anyway, we couldn’t get to find a real solution yet nor a thread talking about it but this one.

I notice that the hideFlags documentation has been updated - I really couldn't understand what was going on with some of that stuff. One of the really annoying things being that objects created when the application is quitting but is still reporting isPlaying are persisted to edit mode - with DontSave turned on that caused loads of problems and was one reason why some of my editor tools were causing reimports.

–

this is a spectacularly informative answer { Do you know anything about Facebook, frarees? Wanna job? }

–

@whydoidoit Where's that updated doc? I'll take a look in https://github.com/unity3d-jp/unity-doc/tree/master/en, the bleeding-edge documentation lair @Fattie feel free to contact me privately

–

facepalm - I've always thought it strange there is no "private message" system on this board. of course, all the cool people just use that feature on the "forum" web site where the nicknames are the same. doh!

–

Not using MonoDevelop, and elsewhere in the thread i've commented on the effects persisting regardless of GIT presence on the machine. I pretty much have to use GIT for my projects though, boss demands it.

–

I don’t know why… but to fix try Edit>preferences and maybe turn off auto-refresh

As benign as your comment is (and as many times as I see it posted as a 'fix') this is not a solution.

–

just curious, does it have an effect?

–

also, is it possible the folder containing the project is linked to some other type of file-sharing/online back-up/version control/etc.. or maybe a network folder or something.. I know you've probably thought of that already...

–

It often gets caught in an endless loop as described above, making it a tedious process to resume work. The timestamp for the last modification of these files isn't changed, only Unity3D claims there was a change.

–

what if you turn off internet/network altogether? still?

–

I recently had this same problem. I deleted a folder, and although the entire folder appeared deleted in the unity project view, it kept reimporting. Turns out I had .pdf file from that folder still open, so it was locked. Closing the file fixed the problem.

This is what fixed my problem. I had the readme file open in a pdf reader! As soon as I closed it, I was able to actually delete the imported asset.

–

I had a similar problem with assets being endlessly reimported as a result of working on both a Mac and a PC. I did my development on a Mac, but then did builds on a PC. I used rsync to keep the two machines in sync, but every time I updated the PC, all of the assets would get reimported, even if I made very minor changes. The work-around I discovered was that if I didn’t update the Library/AssetServerCacheV3 file on the PC during the rsync (either backing up and restoring the existing file or using the --exclude flag), I could avoid the reimport.

I see this is an old thread, but I mentioning this in case it’s useful to someone else.

Watch out for symlinks, i had to delete one of mine to fix this kind of issue.

I Had similar issue and none of the above worked for me.

Issue: Imported a particle plugin from asset store and since dint find a need tried to delete it but it kept coming back over and over after every delete operation as if my system was pocessed;)

Solution:

  1. Tried all the above: dint work

  2. tried renaming before deletion :didnt work

  3. Started deleting files individually and finally found one file that was causing the issue. It was the import setting file of the plugin. It says clearly that “Once a native plugin is loadedit is never never unloaded … blah blah blah…”

  4. so i manually deselected the platforms and deleted the folder and it worked!!