Hello all,
As the thread title says, I’m seeing a very curious/frustrating case of my Unity project getting into a state where my custom AssetPostprocessors, in this particular case, the OnPostprocessAllAssets calls, running at the start up of the Editor every time I open it. When I look at the Editor.log file, it shows that no assets have been imported (as in, there is no logging indicating an asset has been imported). However, when I attach a debugger and break into one of my calls, it shows the importedAssets array size to be every asset in the entire project. This is the last bit of Editor.log output just before the calls begin:
Mono: successfully reloaded assembly
- Completed reload, in 5.524 seconds
Platform modules already initialized, skipping
RefreshInfo: InitialScriptRefreshV2(NoUpdateAssetOptions)
RefreshProfiler: Total: 14879.112ms
InvokeBeforeRefreshCallbacks: 4.076ms
ApplyChangesToAssetFolders: 0.287ms
WriteModifiedImportersToTextMetaFiles: 0.000ms
CleanLegacyArtifacts: 0.000ms
Scan: 494.915ms
OnSourceAssetsModified: 0.000ms
UnregisterDeletedAssets: 0.000ms
InitializeImportedAssetsSnapshot: 1.095ms
GetAllGuidsForCategorization: 1.890ms
CategorizeAssets: 2895.065ms
ImportAndPostprocessOutOfDateAssets: 11424.592ms (11389.035ms without children)
ImportManagerImport: 0.000ms (0.000ms without children)
ImportInProcess: 0.000ms
ImportOutOfProcess: 0.000ms
UpdateCategorizedAssets: 0.000ms
RemoteAssetCacheGetArtifact: 0.000ms (0.000ms without children)
RemoteAssetCacheResolve: 0.000ms
RemoteAssetCacheDownloadFile: 0.000ms
CompileScripts: 0.000ms
PostProcessAllAssets: 0.001ms
ReloadImportedAssets: 0.000ms
VerifyAssetsAreUpToDateAndCorrect: 0.000ms
EnsureUptoDateAssetsAreRegisteredWithGuidPM: 3.450ms
InitializingProgressBar: 27.775ms
PostProcessAllAssetNotificationsAddChangedAssets: 1.562ms
OnDemandSchedulerStart: 0.000ms
RestoreLoadedAssetsState: 2.769ms
InvokeProjectHasChanged: 0.000ms
UpdateImportedAssetsSnapshot: 0.000ms
ReloadSourceAssets: 2.815ms
UnloadImportedAssets: 0.035ms
Hotreload: 0.707ms
FixTempGuids: 0.007ms
VerifyGuidPMRegistrations: 0.000ms
GatherAllCurrentPrimaryArtifactRevisions: 0.000ms
UnloadStreamsBegin: 2.669ms
LoadedImportedAssetsSnapshotReleaseGCHandles: 0.048ms
GetLoadedSourceAssetsSnapshot: 3.098ms
PersistCurrentRevisions: 0.000ms
UnloadStreamsEnd: 35.042ms
GenerateScriptTypeHashes: 0.334ms
Untracked: 12.768ms
Detected possible issues with the DeltaDNA SDK configuration. Please run ‘DeltaDNA → Health Check SDK’ for more details.
UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[ ])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogWarning (object)
DeltaDNA.Editor.SdkChecker/<>c:<.cctor>b__2_0 (object,System.Timers.ElapsedEventArgs) (at Assets/DeltaDNA/Editor/SdkChecker.cs:36)
System.Timers.Timer:MyTimerCallback (object)
System.Threading.Timer/Scheduler:TimerCB (object)
System.Threading.QueueUserWorkItemCallback:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem ()
System.Threading.ThreadPoolWorkQueue:smile:ispatch ()
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()
(Filename: /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs Line: 37)
The rest of the logging before it is just the usual start up info, namely the Package Resolve. It almost jumps straight into the AssetPostprocessor once that is done.
Several members of my team have experienced this issue as well. I’m currently on 2019.4.21, however my other team members are on 2019.4.13. The only way to fix this issue is to delete the Library folder, or to be more specific, the Artifacts folder/DB, as that forces the entire project to be reimported again. After that reimport is complete, the issue goes away with successive re-opens of the project.
Has anyone else been experiencing similar issues to this? I would love to try and create a minimal project to report the bug, but finding time to recreate it would prove difficult. Hoping someone from Unity can check the source to discover what other reasons could trigger the calls other than an import.