Search Unity

UI Elements Missing in Build

Discussion in 'Android' started by RudisYuval, Jun 17, 2019.

  1. RudisYuval

    RudisYuval

    Joined:
    Jan 25, 2019
    Posts:
    32
    Hi Everyone!
    I've been Working on an android app (an AR architectural presentation), everything worked great until I built it. Once built, the app is missing several UI buttons (not all buttons!!), both in unity play mode and in android run. All the buttons still exist and respond in editor mode and those that did not disappear during build work great in the app!
    Both surviving buttons and those who didn't make it are identical (practically copies of the same button triggering different animations).
    I am using Unity 2019.1.5 and the SDK, NDK etc downloaded via Unity Hub.

    Did anyone run into something slimier? any fixes? or ideas of possible fixes?

    Thank you for any help
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide the device logs. The syntax I use is "adb logcat | grep -i unity". On Windows, use findstr instead of grep
     
  3. RudisYuval

    RudisYuval

    Joined:
    Jan 25, 2019
    Posts:
    32
    Thanks for the reply!

    I don't know what are device logs and/or how to get them...
     
  4. RudisYuval

    RudisYuval

    Joined:
    Jan 25, 2019
    Posts:
    32
    It is only my second project in unity..
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  7. RudisYuval

    RudisYuval

    Joined:
    Jan 25, 2019
    Posts:
    32
    this is the player log, only thing that popped out is that it says vuforia engine failed to load at some point, but vuforia works both on device and in editor well. no errors any where.
     

    Attached Files:

  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    That's the player log. Please see my post above for capturing the device logs.
     
  9. RudisYuval

    RudisYuval

    Joined:
    Jan 25, 2019
    Posts:
    32
    I've followed the explanation in the your other post, adb logcat | findstr -i unity returns nothing..
     
  10. RudisYuval

    RudisYuval

    Joined:
    Jan 25, 2019
    Posts:
    32
    And once "adb logcat | findstr -i unity" is run command prompt stops working
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    It will always return something if it's working. Ensure "adb devices" works first, then "adb logcat", etc.

    1) Plug in Android device with USB cable, and ensure developer mode is enabled
    2) Run "adb devices", it should show a deviceid
    3) Run "adb logcat | grep -i unity" (or findstr) and leave it running
    4) Run the game on your phone
    5) Press ctrl+C to end the logcat capture.

    Note that you can also call "adb logcat | grep -i unity > output.txt" to write to a text file
     
    Last edited: Jun 18, 2019
  12. RudisYuval

    RudisYuval

    Joined:
    Jan 25, 2019
    Posts:
    32
    thank you for the help! still can't figure out what might be wrong'no errors, exceptions or fails.. the game loads and works fine except for the missing buttons..
     

    Attached Files:

  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Good job getting the logs! Yes, I don't see any errors. I might suggest using numerous Debug.Log statements in your code, they will show up in the logs too.
     
  14. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    Last edited: Jun 19, 2019
  15. RudisYuval

    RudisYuval

    Joined:
    Jan 25, 2019
    Posts:
    32
    Unfortunately I don't write c# yet, working on it. Does it make sense that I am missing only some of the buttons? Since all buttons are essentially the same.
     
  16. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    A longshot, but most likely the layouting for those buttons is wrong, when you build to Android, the game is ran with different resolution, so things might be layouted differently. In Editor's game view, in toolbar, try setting a different resolution and see how your buttons react
     
  17. RudisYuval

    RudisYuval

    Joined:
    Jan 25, 2019
    Posts:
    32
    Tried changing resolutions but it didn't make a difference.. all buttons are rect aligned to the same place, and all buttons are inside a game object set for the size of the UI.