#WebGL build Problems
1 messages · Page 1 of 1 (latest)
have you tried building dev mod il2cpp? then it should not immidieatly crash and show debug logs in red bottom
One sec, let me try.
Hmmmm, no?
So I created a custom "logs" directory ... because the api class was showing issues with a popup console but I obviously couldn't use that but the error says to initialize first... but I literally have the init code being ran on start... doesn't make sense.
Just double checked... I added a custom msg for the error so if I press login and it didn't init then it would say "authname [login error] please init" and of course it did 🤦♂️ ... so that's fun.
Could it be order of scripts get out of sync? for example one start() runs sooner than other script start()? Could you put Degugs on start and check if order of scripts are correcT?
I could try
It's just not wanting to initialize (my auth).
I moved the init function on the login button and switched between start/awake and logged it to a custom logs folder/file and still init doesn't work.
is Init is open source code? you could try add debug log after each line and see if it is called or not
I added a log after the function… so if init fails it gets logged in a txt file… init just keeps failing.
First one you can ignore.
Second one is still the same as last one. That is your core problem.
How do I fix it though 🤦♂️ ... literally can't find a fix to it.
If only it would give you any errors on editor X.x that would make it so much easier........
try forcing initilisation? as if that doesnt run, that means it depends on platform. Only plugins and contiional formating depends on it. try searching #if WEBGL
I tried to force Init... I had to run on start and even had to run when I press a button... still nothing.
so it doesnt find the script at all. so that script is not compiled........
It really sounds like you have plugin which is disabled on that platform.....
but how to find it.
is the auth library you are using is public or private?
i could try to check it out personally when i will have time if it is public
https://github.com/KeyAuth/KeyAuth-Unity-Example
api.cs has all the functions for the auth
func.cs is where I'm calling them
Example: init code is on api.cs but I call init from func.cs ...
Well I found at least one problem. But that is problem with webgl and not il2cpp build.
using System.Threading;
Thread.Sleep(1250);
and other thread things will not work on webgl....... You will be lucky if task will work.
but that still dont explain why il2cpp on windows does not work
I want to be clear:
Init() function starts right? but initzalized = bool is never true?
have you tried adding debug.log in api.cs 126 line?
Have you tried adding Debug.Log in Func.cs 106 line?
I believe in my game I removed all threads and console logs…
Func 106 yes,
Api 126 I don’t remember… I think I added it somewhere else 🤔
New errors ... I combined the classes basically.
So I was able to figure out the main issue so it works with il2cpp and mono now ... but does not load my login scene for webgl... so it kind of works more now lol. 0 errors ... just doesn't load, lmao.
Glad to hear that. That is huge step forward! I know It will be horrible way for debug, it could be easier if that would be not webgl.... But add Debug.Log () for each function and value that controls it start and not. then build and try to find exact spot where it stops. Then we can think about working around that problem.
What was the problem if not a secret. Have you thought about multithreading problem on webgl I mentioned
? then you cannot use thread features normalyu, maybe thats why it doesnt work on webgl
I've added debug log to just about everything that I could... and nothing 🤔 .
The issue before was that il2cpp could not do my hash/Process.GetCurrentProcess so after removing that it started to work 🙂
So now the game works windows(mono/il2cpp) but does not work webgl. Surely I'll figure it out eventually. Hopefully... when I load it, it literally just doesn't load on webgl.
it must be hard. I hope you will find anything,. if you will any more clues, feel free to share it
I literally have tried everything. I have put logs every where, removed all Threads, literally everything that I could try (that I'm aware of) and it's still not working.
Again, windows mono works ✅
windows il2cpp works ✅
webgl, freezes once the login scene loads.
The function that I assume isn't working is my "init" function.
First picture: is the init function
Second picture: is the request... could it be because it's using WebRequest and not UnityWebRequest? ... not sure why that would matter... I'm literally stuck. I have a debug log saying "if you don't see initialized then error" ... on webgl it never says initialized, but on mono/il2cpp it shows initialize... so it's messing up on the init or req function but I'm not sure which one... even Unity support is clueless about it apparently.