Unity 2021.1.0f1 - "Build and run" not working with Probuilder installed.

Building works, but “build and run” throws these two errors in console.

Destroying assets is not permitted to avoid data loss.
If you really want to remove an asset use DestroyImmediate (theObject, true);
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()

and …

Error building Player: Destroying assets is not permitted to avoid data loss.
If you really want to remove an asset use DestroyImmediate (theObject, true);

If I investigate, it opens up Library\PackageCache\com.unity.probuilder@5.0.1\Editor\EditorCore\StripProBuilderScripts.cs, at …

            pb.preserveMeshAssetOnDestroy = preserveMeshAssets;
            if(useUndoDestroy)
                Undo.DestroyObjectImmediate(pb);
            else
                DestroyImmediate(pb);

Uninstall probuilder and everything works again. Deleted Library folder, no luck.

Edit: Probuilder version 5.0.1 (Release).

1 Like

P.S. having same problem. Uniyt 2021.1.0f1

Seems fixed in v5.0.3 - on Unity 2021.1.2f1

Confirmed - working in 2021.1.0f1 as well!