Search Unity

Runtime Errors after building with Cloud Build

Discussion in 'Unity Cloud Build' started by CDF, Aug 10, 2019.

  1. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    741
    Building with Unity 2019.2.0f1 Android target

    Hey, having a hard time getting my game to run after building from cloud build.
    I think others are experiencing the same issue:

    https://forum.unity.com/threads/clo...t-happens-on-both-android-and-windows.709706/
    https://forum.unity.com/threads/exe-crash-after-ucb-with-tmp-1-4-1-unity-2018-4-lts.707249/
    https://forum.unity.com/threads/exe-crash-after-cloud-build-with-tmp-1-4-1-unity-2018-4-lts.707480/

    before reading those posts I was experiencing the same issue. Immediate crash after booting the game.
    So I took the advice from @Stephan_B and embedded TMP 2.0.1 into my project and removed the #if UNITY_EDITOR define from TMP_FontAsset.

    My build no longer crashes, but now I'm seeing these runtime errors:

    UI.SettingsPopup and UI.LevelSelectScreen are custom classes that extend UnityEngine.EventSystems.UIBehaviour. They have no #if UNITY_EDITOR defines.

    Looking at that script reference: https://bitbucket.org/Unity-Technologies/ui/src/2019.1/UnityEngine.UI/EventSystem/UIBehaviour.cs

    you can see that it has #if UNITY_EDITOR defines:

    unityEditorDefine.png

    Building Locally is fine, no errors, no crash. Also don't need to embed TMP when building locally.
    I've been using Cloud build since it was launched and never experienced issues like this before.

    Has something changed in how Unity serializes data?
    Or how cloud build processed defines?
    Why is Cloud build including code wrapped in #if UNITY_EDITOR now?

    I came across this thread as well which might be related (although quite old now - 2015):
    https://forum.unity.com/threads/if-...tting-compiled-for-web-in-cloud-build.318151/

    Couldn't find any issue on the tracker either.

    I'm pretty stumped here. Can someone on the Unity Cloud team shed some light on this situation?

    @Stephan_B mentioned in this thread: https://forum.unity.com/threads/exe...p-1-4-1-unity-2018-4-lts.707480/#post-4729457 that the issue was known and is being backported.

    Can someone confirm this?

    Thanks
     
    Last edited: Aug 10, 2019
  2. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    127
    ollieblanks likes this.
  3. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    741
    Thanks for the heads up.
    Could be related, didn't check the architecture, just left is as default.

    Once 2019.2.1f1 is up on Cloud Build I'll let you know if the problem persists.
    I'll try and get a bug report up as well. What kind-of information do you need for a Cloud Build bug report?
    Something like a project id?

    Thanks
     
  4. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    127
    2019.2.1f1 is now available in Cloud Build, give it a try and see if it resolves the issue.

    In terms of bug reporting, typically the best process is to submit a support ticket and we can investigate from there.
     
  5. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    741
    Unfortunately the issue is still not fixed. But now the result is different. Unity hangs then crashes.
    Here's the output I get:

    Gonna try building with no x64 support for Android and clean build.

    Should probably mention I'm using latest version of Addressables and building those using a Pre-Export method. I see that they get built correctly in the logs. But wondering if Addressables maybe can't be used on Cloud build yet?

    And again, building locally works fine. Just cloud build fails at runtime.
     
  6. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    741
    Nope, building with no x64 support still broken. Guess I'll have to submit a bug
     
  7. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    127
    Yeah it would be good to submit a support ticket so we can investigate further. Also we have Addressables support very close to releasing right now - currently the frontend is in code review but the backend is deployed and you can test it out by using the API to set your buildtarget
    settings.advanced.unity.addressables
    properties - buildAddressables, uploadAddressables and profileName (leave blank for default).
     
    CDF likes this.
  8. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    127
    Also if you find using the API confusing then feel free to ask us to set those settings on your build target as part of the support ticket and we can make sure it's configured properly.
     
  9. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    741
    This was it. After setting "addressables=true" on the backend my build no longer crashes from cloud build! :D

    I guess manually building addressables through a pre-export script not ideal.
    Was using this script by another forum member: https://gist.github.com/favoyang/cd2cf2ed9df7e2538f3630610c604c51
    discussion: https://forum.unity.com/threads/how-to-trigger-build-player-content-when-build-unity-project.689602/

    I also don't need to embed TMP anymore, phew.
     
  10. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    741
    I managed to figure it out
    Looking forward to seeing a nice shiny button "build addressables" in the frontend ;)

    Thanks again.
     
  11. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    741
    Last edited: Aug 15, 2019