#WebGL build Problems

1 messages · Page 1 of 1 (latest)

keen rose
#

Lets continue it here?

#

have you tried building dev mod il2cpp? then it should not immidieatly crash and show debug logs in red bottom

wanton storm
#

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.

keen rose
#

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?

wanton storm
#

I could try

wanton storm
#

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.

keen rose
#

is Init is open source code? you could try add debug log after each line and see if it is called or not

wanton storm
#

I added a log after the function… so if init fails it gets logged in a txt file… init just keeps failing.

wanton storm
#

Getting these errors now.

#

I fixed the other one some how.

keen rose
#

First one you can ignore.

#

Second one is still the same as last one. That is your core problem.

wanton storm
keen rose
#

If only it would give you any errors on editor X.x that would make it so much easier........

keen rose
#

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

wanton storm
keen rose
#

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

wanton storm
keen rose
#
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?

wanton storm
#

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 🤔

wanton storm
#

New errors ... I combined the classes basically.

wanton storm
keen rose
#

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

wanton storm
# keen rose Glad to hear that. That is huge step forward! I know It will be horrible way for...

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.

keen rose
#

it must be hard. I hope you will find anything,. if you will any more clues, feel free to share it

wanton storm
# keen rose it must be hard. I hope you will find anything,. if you will any more clues, fee...

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.

keen rose
#

I would suggest using UnityWEbRequest indeed, as it is new approach instead of WWW. And Unity have some thingies with webrequests.

#

I have two suggestions.
a)Add debug log to Unity webrequest. there is chance you dont get response on webgl if you go outside your domain.