Unity WebGL build error in NON-development mode only - unity3d

I'm using Unity 2017.3.03f free personal edition, I've an application in unity that works normally in desktop and android platforms. However, When it's built for WebGL release (unchecked "development build" option") it gives this error in browser during loading splash screen:
> An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
uncaught exception: abort(-1) at jsStackTrace (webgl-11B.asm.framework.unityweb:2:27460)
stackTrace (webgl-11B.asm.framework.unityweb:2:27631)
abort (webgl-11B.asm.framework.unityweb:4:33732)
_il2cpp_gc_disable (webgl-11B.asm.framework.unityweb:2:204426)
scripting_gc_disable() [vNc] (webgl-11B.asm.code.unityweb:10:1)
_main [eNc] (webgl-11B.asm.code.unityweb:10:1)
callMain (webgl-11B.asm.framework.unityweb:4:32097)
doRun (webgl-11B.asm.framework.unityweb:4:32800)
_String_Join_m2050845953 [run] (webgl-11B.asm.framework.unityweb:4:32986)
runCaller (webgl-11B.asm.framework.unityweb:4:31614)
removeRunDependency (webgl-11B.asm.framework.unityweb:2:34407)
processDataJob#file:.../Build/UnityLoader.js:1:17079
I've tried to enable the development option and apply the steps of this article:
https://community.gamedev.tv/t/webgl-debugging/54948
to enable debugging symbols and disable stripping code engine to see the errors in browser console. But the Development version works without error, but when I return to release build "unchecking the development option" again, the same error appears.
and the log of browser console contains the following message:
> IndexedDB is not available. Data will not persist in cache and PlayerPrefs will not be saved.
a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:124
unreachable code after return statement[Learn More]
a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:4519
missing function: il2cpp_gc_disable
UnityLoader.js:1:8039
-1
UnityLoader.js:1:8002
-1
UnityLoader.js:1:8039
Use of the motion sensor is deprecated.
a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:54097
Use of the orientation sensor is deprecated.
a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:54097
uncaught exception: abort(-1) at jsStackTrace#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:27460
stackTrace#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:27631
abort#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:4:33732
_il2cpp_gc_disable#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:204426
vNc#blob:null/036e0461-a7f5-4bf6-9bcd-65ad983ad95c:10:1
eNc#blob:null/036e0461-a7f5-4bf6-9bcd-65ad983ad95c:10:1
callMain#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:4:32097
doRun#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:4:32800
run#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:4:32986
runCaller#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:4:31614
removeRunDependency#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:34407
processDataJob.../UnityLoader.js:1:17079
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.
154
UnityLoader.js:1:8002
154
UnityLoader.js:1:8039
uncaught exception: abort(154) at jsStackTrace#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:27460
stackTrace#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:27631
abort#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:4:33732
Vxq#blob:null/036e0461-a7f5-4bf6-9bcd-65ad983ad95c:32:1
y7c#blob:null/036e0461-a7f5-4bf6-9bcd-65ad983ad95c:23:1
ynq#blob:null/036e0461-a7f5-4bf6-9bcd-65ad983ad95c:32:1
handlerFunc#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:57395
jsEventHandler#blob:null/a2ab4d2b-6621-459b-b13f-f9b816ecb2f8:2:53935
why does this error happen? is it because of using unity free edition, or because the application reads some text file from Resources folder at loading?
thanks in advance.

Related

iOS 16.1.1 runtime error: RB query for the extension process state failed

I am working on a project and getting a runtime error when running our app on some colleague's iPhone 11 device(iOS 16.1.1) :
[lifecycle] [u 68C8D161-6D2A-412E-A4F2-CEDE8D1C83EF:m (null)]
[*PRODUCT_BUNDLE_IDENTIFIER(MARKETING_VERSION)*] RB query for the extension process state failed with error: Error Domain=RBSServiceErrorDomain Code=1
"Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state,
NSLocalizedFailureReason=Client not entitled, RBSPermanent=false}
The [PRODUCT_BUNDLE_IDENTIFIER(MARKETING_VERSION)] is something like : com.companyName.AppName.Keyboard(1.0.10)
This error message is only appears when the customized keyboard is loaded,
and the keyboard is also part of app group
I've checked iOS16 release note, seems like nothing is relevant to this error, I'm not sure what is causing this error message?

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.

How to use custom dev-tool for Brave Browser?

I'm debugging wasm code in dev-tool, there is a line limit for displaying the wasm source code, which is 1000*1000 lines by default, when exceeds the limit, it shows ";; .... text is truncated due to the size":
My wasm is larger than that, so I'm trying to build my custom dev-tools. My environment is Kali Linux + Brave Browser.
According to this article, I commented out the lines:
And built successfully, the only difference is that the output directory in the article is ".../resources/inspector" and mine is ".../resources/inspector_overlay".
I tried launch it with --custom-devtools-frontend=file:///root/.../inspector_overlay, when press F12, the dev-tool fails to open, it shows error:
[82506:82549:0121/223355.672780:ERROR:devtools_ui_data_source.cc(306)] Failed to read /root/Downloads/devtools-frontend/out/Default/resources/inspector_overlay/devtools_app.html
[82506:82506:0121/223355.693282:ERROR:CONSOLE(67)] "Uncaught TypeError: Cannot read properties of undefined (reading 'setInspectedTabId')", source: devtools://devtools/bundled/devtools_compatibility.js (67)
How to make it work?
I found from this discuss that the correct path should be gen/front_end, so the param is: --custom-devtools-frontend=file:///root/Downloads/devtools-frontend/out/Default/gen/front_end

Xbox Live User Sign In Failed on Xbox One

I'm testing out the new Creator's Program Unity plugin, and when running the SignInAndProfile example scene on my local machine, it signs me in correctly. However, if I try to deploy it on my Xbox One, the development console gives me the following error:
Warning: unknown type TaskYieldInstruction`1[Microsoft.Xbox.Services.SignInResult] detected. Using reflection to gather its type information. Consider to reference it from your scripts so it can gathered during the build process.
(Filename: C:\buildslave\unity\build\Runtime/Scripting/Backend/DotNet/ScriptingTypeProvider_DotNet.cpp Line: 153)
Exception thrown: 'System.Exception' in Assembly-CSharp.dll
Exception: Sign in Failed. Status: UserInteractionRequired
at XboxLive.<SignInAsync>d__15.MoveNext()
at UnityEngine.SetupCoroutine.InvokeMoveNext(IEnumerator enumerator, IntPtr returnValueAddress)
at UnityEngine.SetupCoroutine.$Invoke1InvokeMoveNext(Int64 instance, Int64* args)
at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)
(Filename: <Unknown> Line: 0)
I can't seem to find anything about what that status message means.
Thanks in advance.
If you're getting an error from RequestTokenSilentAsync, then you should try again with RequestTokenAsync which will bring up any resolution UI.
That said I want to ask first: have you switched your console to the right sandbox? I'm guessing this is likely your issue here.

Error in setting up Google play services in unity

Following the instruction on google play games plugin for unity, I have not been able to set it up correctly. My application crashes on signing in, with the following log output (with no more details). I've got no luck in finding a probable cause and searches seems to be out of any useful tip.
The actual error is displayed as:
Application ID () must be a numeric value. Please verify that your manifest refers to the correct project ID
The complete log output:
10-08 19:43:49.581 25688-25734/? E/linker: readlink('/proc/self/fd/49') failed: Permission denied [fd=49]
10-08 19:43:49.581 25688-25734/? E/linker: warning: unable to get realpath for the library "/data/data/com.testcompany.testapp/app_.gpg.classloader/d75c8e1bbeab9e1ddffb9d332585db71.dex". Will use given name.
10-08 19:43:49.667 25688-25734/? W/PopupManager: You have not specified a View to use as content view for popups. Falling back to the Activity content view. Note that this may not work as expected in multi-screen environments
10-08 19:43:49.675 25688-26526/? I/GamesNativeSDK: Auth operation started: SIGN IN
10-08 19:43:49.675 25688-26526/? I/GamesNativeSDK: Connecting to Google Play...
10-08 19:43:49.802 10946-10956/? W/GamesServiceBroker: Client connected with SDK 9683000, Services 9683438, and Games 37240038
10-08 19:43:49.837 10946-26540/? E/ValidateServiceOp: Application ID () must be a numeric value. Please verify that your manifest refers to the correct project ID.
10-08 19:43:49.842 25688-25688/? D/AndroidRuntime: Shutting down VM
10-08 19:43:49.846 25688-25688/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.testcompany.testapp, PID: 25688
java.lang.Error: FATAL EXCEPTION [main]
Unity version : 5.4.0f3
Device model : LGE Nexus 5
Device fingerprint: google/hammerhead/hammerhead:6.0/MRA58K/2256973:user/release-keys
Caused by: java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
at com.google.android.gms.common.internal.zze$zza.zzc(Unknown Source)
at com.google.android.gms.common.internal.zze$zza.zzv(Unknown Source)
at com.google.android.gms.common.internal.zze$zze.zzauc(Unknown Source)
at com.google.android.gms.common.internal.zze$zzd.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I've taken the steps needed to generate OAuth2 client ID and I've successfully applied that to GooglePlayGame plugin in unity. What could be the reason of the error message?
If we refer to the actual error as shown in your log output, the problem is caused by the application ID declared in your Manifest which is actually one of the top setup mistakes committed by developers as shown in this video.
To troubleshoot this kind of error, please check the following:
For Android:
please verify that the value of the #string/app_id resource matches your application's numeric ID. The value of this resource should only contain digits. For example:
<string name="app_id">123456789012</string>
Warning: Do not use the full client ID (1233456789012.apps.googleusercontent.com) as your app ID. This will result in errors.
For iOS:
The application_ID is the number that Google Play Developer Console assigns to your project. Please note that is not the same as your Apple application_ID.
Then, after checking the application ID, please also check the certificate fingerprint. Please be noted that:
If you are debugging your game using your debug certificate but have configured games services using your release certificate, you should add a second linked app using the same package name and your debug certificate's SHA1 fingerprint. This will allow you to sign in to the application whether it's signed with the debug or release certificates.
For additional tips, refer to these related resources:
Top 7 Google Play games services setup mistakes - Video that describes common Google Play games services setup pitfalls and scenarios.
Android troubleshooting guide - Developer documentation that describes how to troubleshoot issues while developing Android games.
Lastly, this Q&A thread might also help wherein this GitHub post was suggested.
The problem was caused by multiple application configurations in Google play services. Although the game services panel was showing only one application with my package name, there were several instances of the same application configured in google cloud services previously for google cloud messaging and other services. The problem was only solved when I shut down all services, deleted the applications and patiently created one unified application configuration in Google play services.
I got this problem too. Here's My solution:
Delete old version of GooglePlayService and Admob plugins and import the new ones.
Open Android SDK Manager(In Unity, Window -> Google Play Games -> Downloads -> Google Play Gamse SDK(Android)), update the following ones:
Then try to set up Goole Play Service.
Additional, current verion of GooglPlayServices and Admob both import PlayServicesResolver/Editor/Google.JarResolverLib.dll(JarResolverLib.dll), just delete Google.JarResolerLib.dll.
Hope this can help you!