- Home /
Getting a Warning on Build: "Script attached to 'prefab_Name' in scene '' is missing or no valid script is attached." However the prefab it is referring to, as well as the script, have been deleted.
My guess is that there some sort of meta file somewhere that is tricking is into thinking this prefab still exists. If so how would I go about locating and editing that file?
Thanks in advance for any help.
Answer by MattHaughton · Nov 03, 2019 at 11:13 AM
I had the same problem after upgrading to Unity 2019.2.10f1.
To fix I went to Window menu > Package Manager
Then update the Multiplayer HLAPI package. I updated from 1.0.2 to 1.0.4, after that the errors went away
Answer by jchester07 · Oct 26, 2017 at 03:58 AM
Check your scene for a prefab that you deleted from the project folder. It is usually colored red in hierarchy.
Oh that's something I forgot to add, the scene it was in has been deleted as well. What happened was I did some much needed clean up of old outdated junk in my assets folder. I thoroughly checked the remaining scenes using the various scripts floating around, such as this one, however still haven't found anything that remains of this old prefab.
The easiest I can think of is to create a new project and import your assets to the new project.
Answer by Cuttlas-U · Oct 26, 2017 at 05:24 AM
hi; try this : from asset folder >> right click >> Re Import All
Hmm, tried this (good idea), but alas it had no effect. Still get the warning on build.
hi; then give me more detailes; give me a screen shot of the error in the console and the exact time that the error appear i mean if u do any thing special that make it happen ;
The exact warning message is:
"Script attached to 'Sphere (1)' in scene '' is missing or no valid script is attached. UnityEditor.HostView:OnGUI()"
Where 'Sphere (1)' is the name of the gameobject I've since deleted. It occurs whenever I make a build (with or without "Development Build" checked). It also shows up in the build log generated on a dev build. The warning message is to indicate that you have a component that has either been deleted, or no longer derives from $$anonymous$$onobehaviour.
These guys here found that it can occur because a shadow reference to the script can still be on the object even after you deleted it. But my problem is the object itself doesn't exist anymore so there must be a reference to it somewhere that only the build is running into?
I am using version 2017.1.1p4 of Unity. As near as I can tell it has zero negative effect on the project at all, it's just a $$anonymous$$or annoyance. Appreciate the help!
Your answer
Follow this Question
Related Questions
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
How can I stop the variable values reverting to its default values after being built? 1 Answer
Script on nested prefab Loses referance to parent prefab when instantiated 0 Answers
Unity crashed; saved project deleted?? 2 Answers