Search Unity

Scene is black when building to android

Discussion in 'Editor & General Support' started by YousifRagab, Jul 5, 2019.

  1. YousifRagab

    YousifRagab

    Joined:
    Oct 30, 2015
    Posts:
    19
    Everytime I try to build a game to Android it builds successfully but when I install it on my phone it shows the made with unity logo then goes into a black screen. I tried turning off Multithreaded Rendering, enabling 32bit buffer, changing from mono to il2cpp, changing from lwrp to default rp, nothing helped me.

    I tried building another game that I knew worked when I used 2018.3 It had a custom splash screen scene, it loaded this scene and the animation played but after that it went to black when it was supposed to load the mainmenu scene.

    I even tried disabling everything and leaving only the canvas active but it didn't help, although when I made a new canvas with an empty image it showed up in the game with no problems.
    Did something change? like it now has more limitations? The game runs with no problems on my pc, I have a camera active in the scene btw, turning it on or off didn't help. Sometimes the game loads but not always.

    I built this game more than 30 times, I have been having this problem for the past three days.

    I use Unity 2019.1.8f1 (this happened in 2019.1.6f1 as well)
    My test device has Android 4.4.2 custom rom, even with 4.2.2 stock rom it still shows a blank screen

    Anyone else having this problem or know a fix?
     
  2. YousifRagab

    YousifRagab

    Joined:
    Oct 30, 2015
    Posts:
    19
    Update: I added a loading screen with progress text before making the scene load. Unity does load the scene but it takes a lot (about 3-5 minutes) so that's why it stays black.
    I didn't try this to the other game, not sure why it also stays black, it used to load instantly on the same device when built with unity 2018.3
     
  3. viknesh2020

    viknesh2020

    Joined:
    Jul 19, 2016
    Posts:
    52
    @YousifRagab Did you solve this issue? I am facing the same.
     
  4. YousifRagab

    YousifRagab

    Joined:
    Oct 30, 2015
    Posts:
    19
    It turned out the game was loading the scene in the background, even when I made a loading screen scene to load the main scene it looked like it stopped loading but it in fact it was loading the scene, tbh I used many assets in that scene and I came to a conclusion that this is the reason why it takes a lot of time to load the scene especially on a smartphone.

    So try to tweak your settings, decrease the quality, or turn off post processing, decrease the polygon count of your models, also if you are testing on an old device with android version less than 4.4 change Color Space from Linear to Gamma and include OpenGL 2.0.