Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Felipe-T-Moraes · Jul 30, 2015 at 07:58 PM · buildbuild-error

UnityException, Builds Only: "Tag __ is not defined"

I'm building a game since January, and for almost a month I've seen different problems when building a new version.

It all started with functionality loss: my Player was able to attack, but not walk. There was no error with the scripts, the whole game works fine inside Unity. After some research, I found out that there is a bug where Unity won't compile every script and things like that, so I've tried to move all my scripts to Standard Assets, reimport everything, reinstall Unity, etc. After some time, this problem stopped, but a new one started and I can't solve it.

The problem now is with my Loading Screen. What the script do is find the Canvas (with the tag "Canvas") inside the Scene, instantiate a new image inside and call the next scene with LoadLevelAsync. The whole script worked fine in previous builds, and still works as supposed inside Unity, but when I build a new version of the game, it always returns the error "UnityException: Tag: Canvas is not defined.". The thing is, the tag is defined, as it works normally inside the Editor.

I've tried everything as before, reinstalled Unity, moved scripts around, reimported everything; but this time nothing worked. Any ideas how else I could solve this?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Positive7 · Jul 30, 2015 at 08:25 PM 0
Share

Try to remove and re-add the tag in the Tag $$anonymous$$anager. Try to change

 gameobject.tag = "Canvas";

to

 gameObject.CompareTag("Canvas");


or vice versa.

avatar image Felipe-T-Moraes · Jul 31, 2015 at 02:07 AM 0
Share

I've tried as suggested, removed and re-added the tag in the Tag $$anonymous$$anager with no success. Something funny happened though, while trying to change Tags and creating new ones to see if something happened, the $$anonymous$$anager suddenly appeared once with all Tags lost. I tried re-opening Unity (as this proved to be a marvelous unexplained bug fixer during the last few weeks)and the error changed. Now it said the problem was with a NullReference Exception in my LevelLoader script. As I knew the scripts were fine (since I haven't changed a single line of code during this process and they were working as expected inside the Editor), I've asked Unity to Reimport everything. When it finally ended, there was no error left, and I couldn't find anymore problems inside the Build (for now)! Thanks for the help :)

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Android - Error building Player: CommandInvokationFailure: Failed to re-package resources 3 Answers

My android app build has more bugs on it than the editor/deveploment version 0 Answers

Failed to resolve UnityEngine.XR.XRSettings 2 Answers

Build failure: Failed to build apk 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges