Search Issue Tracker

Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.

Postponed

Votes

0

Found in

2020.3

2021.1

2021.2

2022.1

2022.1.0a9

Issue ID

1366036

Regression

No

Errors and warnings logged in the Console when calling AssetDatabase methods during OnValidate that reimports Assets

Asset - Database

-

How to reproduce:
1. Open the attached project "CheckConsistencyLoadAssets"
2. In the Project window, select the asset "SelectMe" (Assets/SelectMe.asset)
3. In the Inspector, right-click the header and select "Display the Error!"
4. Inspect the Console window (Window > General > Console)

Expected result: No warnings or errors are displayed in the Console
Actual result: Several warnings and errors are displayed in the Console

Reproducible with: 2020.3.19f1, 2021.1.22f1, 2021.2.0b13, 2022.1.0a9
Could not test with: 2019.4.30f1 (‘AssetDatabase’ does not contain a definition for ‘RegisterCustomDependency’)

Note: in versions starting from 2022.1.0a8, a message is displayed in the Console window alongside the warnings and errors

Errors:
Destroying GameObjects immediately is not permitted during physics trigger/contact, animation event callbacks, rendering callbacks or OnValidate. You must use Destroy instead.
UnityEditor.AssetDatabase:Refresh ()

Warnings:
SendMessage cannot be called during Awake, CheckConsistency, or OnValidate
UnityEngine.GameObject:.ctor (string,System.Type[])
SendMessage cannot be called during Awake, CheckConsistency, or OnValidate
UnityEditor.AssetDatabase:Refresh ()

  1. Resolution Note (2022.1.X):

    Postponed

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.