Search Unity

iOS 15 + WebGL 2 issue

Discussion in 'Web' started by LW2021, Sep 29, 2021.

  1. michael443959

    michael443959

    Joined:
    Aug 3, 2014
    Posts:
    1
    Maybe possible include this fix into Unity and add some flag to enable it? Our environment depend on Unity Cloud Build and we can't use this fix.

     
    Thaina likes this.
  2. rmgomez

    rmgomez

    Joined:
    Oct 2, 2014
    Posts:
    18
  3. ravi56

    ravi56

    Joined:
    Sep 15, 2021
    Posts:
    7
    hello i'm also facing issue in WebGl in ios ,sprties are flickring . i've try all above method but it didn't work .can some one guide me for this?
     
    bahriztr3432 likes this.
  4. chilledbits

    chilledbits

    Joined:
    Jan 4, 2018
    Posts:
    17
    As far as I know there is still no fix or workaround for the flickering issue!
     
  5. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,164
    If I understand correctly. It was purely apple fault that make this ios update contain a bug in safari memory system and that cause unity to break and they can't fix it from unity side. They need to wait for apple to fix their bug and don't know are there any progress yet
     
  6. tlonuma

    tlonuma

    Joined:
    Feb 5, 2022
    Posts:
    1
    Hi, I also had the same issue. I followed @brendanduncan_u3d's workaround. It fixed the error message, but then I had the flickering issue.

    I realized that most problems were coming because of the .wasm build. Then I created a .asm build (with an older Unity version, 2020, I deleted again the il2cpp cache directory to reverse any changes made to the .cpp file), and it fixed both the error message and the flickering issue.

    Overall, it seems that the .asm build is much more stable (even though it may not be the current best practice).

    I think I'll continue working with .asm until there is a fix coming for the next iOS.
     
  7. AnthonyKozak

    AnthonyKozak

    Joined:
    Feb 4, 2019
    Posts:
    6
    I applied the fix, removed the Library/Bee folder, restarted unity and compiled a new build. I still get the same errors so far:

    Code (CSharp):
    1. ...
    2. LOGNot implemented: Class::FromIl2CppType
    3. LOGNot implemented: Class::FromIl2CppType
    4. LOGNot implemented: Class::FromIl2CppType
    5. ERRORexception thrown: RuntimeError: Out of bounds memory access (evaluating 'Module["asm"]["_main"].apply(null,arguments)'),<?>.wasm-function[479]@[wasm code]
    6. <?>.wasm-function[18229]@[wasm code]
    7. <?>.wasm-function[18226]@[wasm code]
    8. <?>.wasm-function[18223]@[wasm code]
     
    barraxworld likes this.
  8. chilledbits

    chilledbits

    Joined:
    Jan 4, 2018
    Posts:
    17
    iOS 15.5 beta 4 fixed the Flickering issue for us!
     
    Last edited: May 4, 2022
    Thaina and unityruba like this.
  9. ravi56

    ravi56

    Joined:
    Sep 15, 2021
    Posts:
    7
    i have IOS 15.4.1 ,but stil have Flickering issue .
     
    barraxworld likes this.
  10. AnthonyKozak

    AnthonyKozak

    Joined:
    Feb 4, 2019
    Posts:
    6
    iOS 15.5 beta 4 fixed the game loading, but not the flickering apparently
     
    maximiliananzinger likes this.
  11. barraxworld

    barraxworld

    Joined:
    Nov 22, 2015
    Posts:
    5
    I used the fix provided earlier to get the game to run and then setting my UI / Canvas to screen space overlay stopped all the flickering for me. Thanks.
     
  12. TyrantNomad

    TyrantNomad

    Joined:
    Jul 4, 2013
    Posts:
    6
    Same - the initial workaround ensures that the game at least runs, and the Overlay canvas change ensures that it does not flicker.

    Even if/when the fix is deployed, I'd recommend both workarounds to be applied to your projects until adoption rate of system versions with the fixes is almost guaranteed.

    Also, if anyone else was using particle systems combined with Screen Space - Camera, this will help your transition to Screen Space - Overlay:
    https://github.com/mob-sakai/ParticleEffectForUGUI#installation

    Personally, I had to add an additional script to make the screen-scaling work properly again - the default seemed borked - if you're using physics in your particles, additional adjustments might be required as well.

    This is what is currently applied to our particle systems and seems to work nicely:
    baseFactor - UIParticle Scale: 100
    ScreenScaleFactor: (float)referenceWidth / (float)Screen.width
    Dynamic Scale: baseFactor * ScreenScaleFactor
    GravityMultiplier: startingValue * (1f / ScreenScaleFactor)
     
  13. vcappa

    vcappa

    Joined:
    Apr 26, 2017
    Posts:
    2
    I can't believe it worked! Thank you so much!
     
  14. canCaglarCmos

    canCaglarCmos

    Joined:
    May 6, 2022
    Posts:
    3

    this is solving the problem but flickering issue is still available when using screen space camera and I need to use screen space camera.
     
  15. bahriztr3432

    bahriztr3432

    Joined:
    Jan 30, 2020
    Posts:
    1
    Same! Please need help!
     
  16. Benjiz

    Benjiz

    Joined:
    Sep 29, 2016
    Posts:
    5
    Webgl on safari ios/mac still slow & flickering with 1sc black screen or noise

    EDIT :
    That was before I deleted webglcache in project folder
     
    Last edited: May 14, 2022
    canCaglarCmos likes this.
  17. youxigame

    youxigame

    Joined:
    Mar 8, 2022
    Posts:
    1
    I followed this solution, but a new error was thrown about shader.
     
    canCaglarCmos likes this.
  18. peclml14

    peclml14

    Joined:
    May 17, 2022
    Posts:
    1
    Guys I ended up here for the ScreenSpace - Camera *UI Flickering* issue. I noticed the canvas scale was almos zero 0.01, when Screen Space Overlay it was positive.

    So I changed the orthographic camera size from 5 to 2.000. For the scaling to be positive number, it became 7 dot something.

    Still testing, but I wonder if this scaling when rounded to zero at 0.01 would cause these ui flickering isues.

    -- EDIT

    No success, it stopped working well on other devices at first attempt

    -- EDIT

    TOTAL SUCCESS, it didn't work in the first attempt because i was changing z position for negative numbers before this attempt of scale stuff. Changing back to default ZERO z axis for UI it worked. I think the issue was really the almost zero Z scale for canvas.

    -- EDIT

    iOS 15.4 the flickering still appears after some time.
     
    Last edited: May 20, 2022
    M_R_Antonio and Thaina like this.
  19. DavidLeertasteW

    DavidLeertasteW

    Joined:
    Dec 17, 2017
    Posts:
    5
    rmgomez, we had the same issue. Brendan's fix sadly only fixes the default pipeline builds, not the URP or SRP. However, the 15.5 iOS update which was released a couple of days ago finally is able to open URP Web GL apps. Not everything works perfectly yet, but after days agonizing over even getting the page to load, this is a massive win!

    Edit: We are still also using Brendan's fix. I am not sure if it would work without it.

    Edit 2: If you run into immense performance problems with URP on Web GL, we found GPU instancing of materials to be the problem on iOS 15.5. once you turn that off on your materials, it works like a charm.
     
    Last edited: May 22, 2022
    rmgomez, sub-zero5 and Thaina like this.
  20. Phobetor

    Phobetor

    Joined:
    Jan 12, 2017
    Posts:
    3
  21. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    437
    @Phobetor The work-around would have no noticeable impact, and would have nothing to do with getSupportedProfiles.

    @DavidLeertasteW 15.5 should not require the work-around anymore. For GPU instancing being slow, I found the Metal shader compiler is *very* slow for GPU instances, when Angle translates large uniform arrays from GLSL to Metal. I got a fix into the latest Unity (not sure if it's released), and I'll get it backported. The fix limits the batch size for GPU instances on MacOS, avoiding the slow compiler issue.
     
  22. Phobetor

    Phobetor

    Joined:
    Jan 12, 2017
    Posts:
    3
    Ok @brendanduncan_u3d, thanks for your reply!

    Anyway I made some tests:
    1) It seems that with some Android versions (like v4.4 for example) it throws the error "getSupportedProfiles is not a function"
    2) I made builds both with and without the engine workaround, and I think that there is the problem, because without the engine workaround the Android versions work well (while iOS 15.4 not), and viceversa...
    3) I also tried to install latest Unity 2021 version, same thing, except for the fact that on Android it throws another error (see image below about Android v4.4):

     
  23. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    437
    @Phobetor Please file a bug if you think there is a problem, if you haven't already. It's too hard to keep track of all the problems if they aren't logged. I did a grep to see if we're calling getSupportedProfiles and didn't immediately see it used. Unless it's some other "getSupportedProfiles" function, the typical place that would be called is to query whether the ASTC texture compression WebGL extension supports LDR or HDR profiles. I don't know if that's the one you're hitting, and it's certainly not clear how that has anything to do with disabling the optimization of an unrelated function. But stranger things have happened.

    Now that 15.5 has been released, the work-around should be less necessary. I hope we can all move on to 15.5 and try and forget 15.4 ever happened.
     
    De-Panther likes this.
  24. mmdjn

    mmdjn

    Joined:
    Aug 26, 2020
    Posts:
    1
    Hi,

    @peclml14
    For the flickering issue I used "ScreenSpace - Overlay" with this config in "WebGLTemplates" and the flickering issue on GameObjects and UI has been solved
    Code (JavaScript):
    1. config["webglContextAttributes"] = { "preserveDrawingBuffer": true };
    But now i'm facing @Phobetor issue "ext.getSupportedProfiles is not a function at _JS_SystemInfo.HasAstcHdr .."
     
  25. canCaglarCmos

    canCaglarCmos

    Joined:
    May 6, 2022
    Posts:
    3
    I think not using Screen Space - Overlay is not a solution in my opinion. In some cases, it may be necessary to use ScreenSpace - Camera in games.
     
  26. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    437
    @mmdjn What version of Unity are you using? In the versions I checked that have
    JS_SystemInfo_HasAstcHdr (2021.3+), they all have:
    Code (CSharp):
    1. if (ext && ext.getSupportedProfiles) {
    2.     return ext.getSupportedProfiles().includes("hdr");
    3. }
    which should check to see if getSupprotedProfiles is available. If you do a development build, and look in the built framework.js for JS_SystemInfo_HasAstcHdr, does your version have this check?
     
  27. elmax

    elmax

    Joined:
    Oct 6, 2013
    Posts:
    19
    I get very low FPS on iOS using 15.5 . Progress ist that it is actually working, but still not useable...
     
    sub-zero5 likes this.
  28. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    437
    @elmax Can you file a bug for the slow performance?
     
  29. sub-zero5

    sub-zero5

    Joined:
    Apr 7, 2022
    Posts:
    2
    Hi all

    2 weeks ago after the release of ios 15.5 i was able to open my build on iphone but the performance was really bad although it was running smoothly on Android phones and windows 10
    My build is using the standard rendering pipeline

    Recently for the past week it is no longer running on iphone and giving me that error
    "A problem repeatedly occurred"

    Any idea how i can fix this
     
  30. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    437
    @sub-zero5 You can try deleting your Safari cache (Settings / Safari / Clear History and Website Data). Otherwise, without a bug report with a repo, there's not much to go on.

    I know Google is still fixing some shader compiler issues with WebGL Metal (which is used on iOS). We should really identify these performance issues, especially if they occur on MacOS Safari, because MacOS Chrome will be switching to the WebGL Metal implementation soon.
     
  31. sub-zero5

    sub-zero5

    Joined:
    Apr 7, 2022
    Posts:
    2
    I tried to run it on 3 different iphones tried chrome all giving me the same error

    Any hint on how to do a bug report?
     
  32. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    437
    @sub-zero5 If you can make a minimally reproducible example, file a Unity bug with the repo example, and that will be good. Without a minimal repo example, I would have to guess any problem I'm seeing is the one you're seeing, and that rarely works out.
     
    sub-zero5 likes this.
  33. canCaglarCmos

    canCaglarCmos

    Joined:
    May 6, 2022
    Posts:
    3
    Is there any news about the flickering issue?
     
  34. M-SugayaTakuma

    M-SugayaTakuma

    Joined:
    Apr 9, 2020
    Posts:
    12
    Although not an iOS15 topic, this problem seems to have recurred in iOS16.
    When tested on the beta version of iOS16, the WebGL game crashed while launching in Safari. It occurred even in almost simple configurations.
    Unlike the iOS 15.4 issue, no error message is displayed.
    It is possible that this will be fixed before the official release of iOS16, but it is also possible that it will be released without being resolved like the previous issue.
    I would like to propose this issue here, should we do a separate topic or Issue? Thanks.
     
  35. BlackDragon94

    BlackDragon94

    Joined:
    Apr 5, 2022
    Posts:
    3
    @brendanduncan_u3d
    I hope you help me.
    I also get an error "an error occurred running the Unity content on this page. See your browser javascript console for more info".
    I built the WebGL game with Unity 2021.3.4f1 and tested it on the Chrome browser.
    upload_2022-7-22_10-22-45.png
    this is an error of my project tested in React.
    upload_2022-7-22_10-24-2.png
     
  36. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    437
    @DarlingSSHan This looks like a different issue than the iOS 15.4 issue in this thread. It would be good to make a new forum thread for it. I don't know what this wasm:// URL is, or who's creating that URL, that looks really strange. I don't know much about React, maybe it's doing something weird.
     
  37. chilledbits

    chilledbits

    Joined:
    Jan 4, 2018
    Posts:
    17

    We experience the same again with iOS 16 :(
     
  38. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    437
    @chilledbits Thanks. What are you testing that is failing, and what version of iOS 16?
     
    Last edited: Aug 22, 2022
    chilledbits likes this.
  39. chilledbits

    chilledbits

    Joined:
    Jan 4, 2018
    Posts:
    17
    So actually I have to correct myself: Our Webgl build is working again on iOS16 Beta-6
    Fingers crossed that it remains like that until the official release.
     
    brendanduncan_u3d likes this.
  40. Marek_Bakalarczuk

    Marek_Bakalarczuk

    Joined:
    Dec 28, 2012
    Posts:
    114
    Is it possible, that this error is again in iOS 16? I build on Windows, and nothing I do, I get call_indirent on null table
     
  41. mengqiwei

    mengqiwei

    Joined:
    Mar 15, 2022
    Posts:
    7
    Hello!brendanduncan_u3d,
    The Unity version used is 2020.3.35F1


    On any phone running Android, you can open it, but on an iphone, the link won't open. Most of the time, it flashes and then reloads, i'll put in a video, and you can see https://youtube.com/shorts/pUxma0yBJ_c?feature=share


    Looking forward to your reply, thank you
     
    Thaina likes this.
  42. leenaviradiya1

    leenaviradiya1

    Joined:
    May 7, 2019
    Posts:
    2
    hey @brendanduncan_u3d Any Updates regarding the Image flicker issue?, and also can someone please provide best practices for webgl Builds and settings
     
  43. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,164
    As of ios 16 this issue that the webgl will refresh itself after loading scene, sometimes eventually after loading second scene, still persist and only get worse
     
    cmortizm likes this.
  44. arjuniscool0204

    arjuniscool0204

    Joined:
    May 16, 2017
    Posts:
    14

    Hey brendan, after applying this fix for iOS 15 I get a new error. The game runs normally after closing the error. Looks like something audio related but not sure what it is.

    An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
    NotSupportedError: The operation is not supported.
    play@[native code]
    @https://dcklsnvoejo0x.cloudfront.net/25EZa/Build/Mobile.framework.js:3:57721
    jsAudioPlayPendingBlockedAudio@https://dcklsnvoejo0x.cloudfront.net/25EZa/Build/Mobile.framework.js:3:53525
    @https://dcklsnvoejo0x.cloudfront.net/25EZa/Build/Mobile.framework.js:3:53726
    forEach@[native code]
    jsAudioPlayBlockedAudios@https://dcklsnvoejo0x.cloudfront.net/25EZa/Build/Mobile.framework.js:3:53677
    _userEventCallback@https://dcklsnvoejo0x.cloudfront.net/25EZa/Build/Mobile.framework.js:3:54263
     
  45. cmortizm

    cmortizm

    Joined:
    Jan 10, 2021
    Posts:
    3
    I was experimenting the same issue and after implementing the workarround from @brendanduncan_u3d I still had to brake my game scene into smaller scenes to have it not load all at once. Here are my player settings, hopefully this is useful to you and anybody else.



    upload_2023-5-12_16-2-14.png upload_2023-5-12_16-2-43.png upload_2023-5-12_16-2-59.png
     
    Thaina likes this.
  46. Ricardo_Rodrigues

    Ricardo_Rodrigues

    Joined:
    Apr 4, 2022
    Posts:
    1
    O problema continua no webGL para IOS. Esse problema de WASM precisa ser solucionado pela Unity. Alguem conseguiu resolver isso?
     
  47. fxlange

    fxlange

    Joined:
    Dec 20, 2016
    Posts:
    45
    Our application is silently crashing or restarting on ios safari (16.5). Unity 2022.2.12 and 2022.3.
    I haven't found a way to get any information about the crash/restart.

    It is always happening, sometimes almost immediately, sometimes after a few secs even without any interaction. No scene switches involved.

    Anyone experiencing the same or any tips how to track the issue down?
     
  48. fxlange

    fxlange

    Joined:
    Dec 20, 2016
    Posts:
    45
    It seems to be caused by the new default setting "webgl via metal" under safari -> advanced -> experimental settings. I turned it off and now app runs smooth. Unfortuntelay this is good to know but is not a scaleable solution :/
     
  49. gosoon

    gosoon

    Joined:
    Jun 9, 2023
    Posts:
    17
    I deleted my il2cpp file and rebuilt, but the folder is not newly created. What should I check?
     
  50. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    273
    Can you attach a build zip file here for me to take a quick look? It can give me an indication whether or not we need a full-fledged bug report for it.
    Also, did this just start occurring with iOS 16.5? was it not crashing in previous iOS versions?