• 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
1
Question by Dagra · Mar 18, 2015 at 12:47 PM · androidbugtag

Is there a Unity 5 Bug affecting tags with Android builds?

After upgrading to Unity 5 I noticed my code worked in the Unity Debug Player but not when I push it to my android devices. Is this a known bug? If so I could not find it documented anywhere.

I noticed it initially with my collision gameObject.CompareTag("SomeTag") they just were not working when I pushed the builds to device for testing.

I simplified it to the below test and it still works in Unity Remote but not when I push it. debugText is a UI Text

 void OnTriggerEnter(Collider c)
 {
     debugText.text += "\nHit " + c.tag.ToString();
 }


Comment
Add comment · Show 4
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 Dagra · Mar 18, 2015 at 08:30 PM 0
Share

After spending most of last night adding debug comments and rebuilding the project I finally broke down and built a new project this afternoon and did some simple collision and tag comparisons testing with cubes and everything seems to work fine.

$$anonymous$$y next guess is something happened with the project upgrade. So I guess I will be exporting assets and rebuilding my project from scratch tonight. Hopefully that fixes it and I wont have to rebuild the objects themselves.

I actually took the assets from my working test and imported them to my 4.6 upgrade package and they started doing the same thing once in that package.

avatar image SaraCecilia · Mar 19, 2015 at 01:16 PM 0
Share

Hi, known issues are listed in our release notes (for future reference): http://unity3d.com/unity/whats-new/unity-5.0

I have done a quick search in our bug reporting system for your issue (you can also do a search on our issue tracker: http://issuetracker.unity3d.com/) but haven't found yet a reported bug for a case similar to yours. Let our devs know by creating a bug report: http://unity3d.com/BugReportingFAQ

avatar image Fucken · Apr 26, 2015 at 07:27 PM 0
Share

I had a problem like this and solved it this way:

Try checking the tag list in editor going to the "Add Tag" menu and check that the tag you are using is there

I had my "Pick Up" prefab with the "Pick Up" tag and the "Pick Up" tag was showed on the inspector for every "instance of the prefab" (I don't know if you say it this way)

But then I checked the "Add Tag" menu and the Tag List was empty, so there was the problem.

avatar image malegorino · Mar 30, 2017 at 01:29 PM 0
Share

I had the same problem on android device. In my case I removed a tag and Unity needed to update the tag list, so once reloaded the project worked fine.

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by bkachmar · Apr 30, 2015 at 06:19 PM

Hi,

I just had almost the same issue, but I was building for PC. In my case after Upgrading the project to Unity 5 all the tags from project settings disappeared. Somehow everything worked in editor, but after packaging it crashed. So I just added all the tags to project settings and to game objects and now everything works.

Hope this will help you.

Comment
Add comment · Show 1 · Share
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 LuckierBread · Aug 30, 2016 at 08:51 PM 0
Share

This is it. For some reason when I tried to build my project it deleted all the tags without me knowing. seems like a bug but once you know what is happening it is an easy fix.

avatar image
1

Answer by chrisvarnsverryvirtualarts · Jul 25, 2017 at 09:22 AM

In my limited experience, after adding a new tag, that tag won't work for me on Android until I restart the editor on PC.

Comment
Add comment · Show 1 · Share
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 samuelb_unity · Aug 27, 2018 at 01:38 PM 0
Share

Thank you! I had even tried creating new tags and switching the code to use the new tags and they would all get ignored. Restarting the editor and rebuilding for Android worked.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

AssetBundles don't load to scene on Android device. 3 Answers

Android 6.0 Marshmallow creates black bar along bottom of screen. 4 Answers

Unity Analytics Service is broken 0 Answers

Head tracking lost on GearVR, logs show TrackingServiceConnection.onServiceDisconnected() 0 Answers

Strange collision problem with block and terrain 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges