Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unable to get webGL build to work on macOS / iOS

Discussion in 'WebGL' started by Sheceido, Sep 5, 2022.

  1. Sheceido

    Sheceido

    Joined:
    Jul 10, 2022
    Posts:
    2
    Hello Unity Community,

    I've been searching the forums and other sites and I have yet to be able to solve my issue. My current webGL build can be found here on itch.io (build on Unity v.2021.3.8f1):

    https://sheceido.itch.io/perfect-stack?secret=qLQDazHfFWPCLzWjTERhl55hNM

    As the title suggests, friends who have a macOS or iOS are not able to load the game properly:
    iOS - displays splash screens => "loading" scene appears (that only contains a canvas) => then freezes and displays "a problem repeatedly occurred on "<game url>".
    macOS - able to load into main menu screen with animation playing, but user is unable to see or interact with canvas buttons.

    For windows and android users, everything works as intended.

    The most relevant post on the forum that somewhat matched what I thought was the issue was from this thread: https://forum.unity.com/threads/ios-15-webgl-2-issue.1176116/#post-7982496
    But I was unable to solve my issue with the solution that was suggested there. I've had my friend go on "https://get.webgl.org/" to make sure webGL is enabled on their device/machine, and they do indeed see the spinning cube.

    As I do not personally own a macOS or iOS phone, I'm unable to enter into the dev tools in the browser to see what might be happening. My friend had sent me a screenshot on their end of a macOS, but the warnings are foreign to me. Maybe my google-fu is rather weak, but I'm not sure what steps I can take to resolve it. devtoollog.jpeg

    I was wondering if it's some changes that need to be made on my end, or does macOS / iOS still have issues with webGL applications?

    Thank your for all of your time!

    Below are my settings for the build:

    buildSettings.png

    Player Settings:

    playerOtherSettings.png

    publishingSettings.png
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,196
    FWIW it does the same thing on my iPad (6th Gen): Loading appears, then website gets reloaded due to script error or something.

    WebGL is extremely finicky when it comes to running on Mobile devices specifically. I'm surprised Unity has removed the "not officially supported" flag in the past two years. But then again, we have been able to make iOS builds that work reasonably well and/or stable on (powerful) mobile devices. And your example seems like something really any device/browser should be able to handle, unless you slammed flat-colored 4k textures onto those cubes. ;)

    The gist is: unless you have a device to test against and you've been developing the app while testing builds on that device frequently (ie at least every major feature add/change) it will be next to impossible to debug and fix issues like these. It could be anything from generally using too much memory, a short memory spike that puts too much pressure on the GC for a frame, incompatible assets or settings, and so on.

    The best you can do is to provide testers with a develop/debug build and tell them how to send you the console errors, like what you posted above. You will not get useful info out of this from a release build.

    You may also want to interleave a lot of Debug.Log() calls to any code you may be suspecting to be the culprit, thus by checking the logs you know up to which point it seemed to be working okay. It will require patience by both you and testers to keep trying until you hopefully find something that works.

    Stripping the game to bare minimum and aggressively changing settings to be most compatible, consume least amount of memory, etc. could also lead to eventually finding that one thing (if it's one) that causes the issue.
     
  3. Sheceido

    Sheceido

    Joined:
    Jul 10, 2022
    Posts:
    2
    Hmm I see, thanks for your advice CodeSmile. I'll see what I can do and for any progress I'll update this thread for future goers that may have similar issues!