unity-game-enginegithub-pagesunity-webgl

Unity WebGL on GitHub Page: [libil2cpp] ERROR: Could not open Il2CppData/Metadata/global-metadata.dat


I exported WebGL in Unity.
It's works on Itch.io, but it cannot run on Github Page and repit is the same probelm.

Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'interest-cohort'.
PopTeacherComplete.loader.js:1 [UnityCache] 'https://rogewood.github.io/PopTeacher/Build/PopTeacherComplete.data' successfully downloaded and stored in the indexedDB cache
PopTeacherComplete.framework.js:2 
        
       no boot config - using default values
[libil2cpp] ERROR: Could not open Il2CppData/Metadata/global-metadata.dat
PopTeacherComplete.framework.js:2 RuntimeInitializeOnLoadManagerInitializer: Failed reading 'RuntimeInitializeOnLoads.json'
PopTeacherComplete.framework.js:2 RuntimeInitializeOnLoadManagerInitializer: Failed reading 'ScriptingAssemblies.json'
PopTeacherComplete.framework.js:2 No GlobalGameManagers file was found at , quitting player!

PopTeacherComplete.framework.js:2 Failed to initialize player

I think the problem is i use git lfs or not support libil2cpp, but I don't know how to solve it.


Solution

  • I was also having this issue.

    Found solution here: https://forum.unity.com/threads/webgl-no-boot-config-using-default-values-help.880978/

    if Git LFS was used to push your files to GitHub, change the reference in index.html For example, instead of:

    dataUrl: "Build/[Filename].data",

    Use:

    dataUrl: "https://media.githubusercontent.com/media/[GitHub Username]/[Repository Name]/[Branch]/Build/[Filename].data"

    I had to do something like this to make it work:

    enter image description here