2

I've been using unity for quite some time. But I downloaded the latest version 2017.2.1f1 and started a new project. Everything is running fine in the game and scene view. Playing the game in the editor is working fine as well. However, when I build it to my android device (API Level 19). The Canvas and all of the UI elements are not visible. The Render Mode for the Canvas is set to Screen Space Camera and UI Scale is Scale with screen size. I tried looking around but I'm not able to find a fix that works in my case scenario. Any help will be much appreciated.

Please note that I'm working on a 2D game so the environment is set to 2D, if that helps in any way

Harman Kamboj
  • 429
  • 7
  • 20
  • 1
    try running on device using Unity Remote and see the results – Umair M Dec 16 '17 at 00:23
  • 1
    [Use this guide](https://support.unity3d.com/hc/en-us/articles/205485376-How-do-you-debug-on-Android-) to debug your app.. I don't really see another option to find that error. [How to remote debug](https://docs.unity3d.com/Manual/AttachingMonoDevelopDebuggerToAnAndroidDevice.html) Using these technics you should be able to find the cause. If that is not the case, please edit your question to provide the new information you gathered through debugging – Tobias Theel Dec 17 '17 at 23:10
  • I'll be closing this answer. I found the solution out. The project for some reason was not importing all the required libraries so I had to delete the project build folder and let unity rebuild it. Thanks for your help though, I find that guide handy. – Harman Kamboj Dec 17 '17 at 23:13
  • 1
    Dont close/delete! [Answer your own question](https://stackoverflow.com/help/self-answer) and provide the information there. And don't forget to accept that answer. That could be of help for future developers! I'm glad i could atleast provide some useful information :). – Tobias Theel Dec 17 '17 at 23:14
  • Yes, sorry that was my intention. I'm bad at English between 3-4 AM for some reason – Harman Kamboj Dec 17 '17 at 23:16

1 Answers1

2

Let's say you are porting your project from an older version of unity. OR Unity crashed while you were actually building the project. Under these scenarios. Unity might not include all the required shaders and in some cases Classes for some reason. However there is a really easy work-around over this. Just follow the steps as listed:

  1. Close Unity
  2. Browse to the folder/directory of your project.
  3. Delete the Project Settings Folder. (It might delete some editor settings but as far as your project is concerned nothing is going to change.)
  4. Open Unity again and open your Project.
  5. Unity will rebuild the project and the error will be fixed.
Harman Kamboj
  • 429
  • 7
  • 20