People playing my game keep getting this error, please help

I have this very frustrating error people playing my game are getting…

It happens on both my server, or on my local PC.

At first the game plays after I build it, but if I play for a while, then refresh the game page, the error occurs.
And thereafter, the game cannot be played again, as the error occurs all the time.
This is in Chrome 64-bit, but others have had it in Firefox too.

Uncaught Assertion failed: genericTypeDefinition->event_count == genericInstanceType->event_count, at: C:\Program Files\Unity 5.4.1f1\Editor\Data\il2cpp\libil2cpp\vm\GenericClass.cpp,106,SetupEvents at Error
at jsStackTrace (blob:http://localhost:63872/953c69bd-9d9f-47ab-aeb0-7b41b235ee26:1:22715)
at stackTrace (blob:http://localhost:63872/953c69bd-9d9f-47ab-aeb0-7b41b235ee26:1:22898)
at ___assert_fail (blob:http://localhost:63872/953c69bd-9d9f-47ab-aeb0-7b41b235ee26:1:268257)
at qDy (blob:http://localhost:63872/953c69bd-9d9f-47ab-aeb0-7b41b235ee26:25:563410)
at biz (blob:http://localhost:63872/953c69bd-9d9f-47ab-aeb0-7b41b235ee26:25:980622)
at Array.ciz (blob:http://localhost:63872/953c69bd-9d9f-47ab-aeb0-7b41b235ee26:25:982818)
at Object.qbD [as dynCall_vii] (blob:http://localhost:63872/953c69bd-9d9f-47ab-aeb0-7b41b235ee26:43:420744)
at invoke_vii (blob:http://localhost:63872/953c69bd-9d9f-47ab-aeb0-7b41b235ee26:1:379205)
at tqy (blob:http://localhost:63872/953c69bd-9d9f-47ab-aeb0-7b41b235ee26:25:295974)
at g0g (blob:http://localhost:63872/953c69bd-9d9f-47ab-aeb0-7b41b235ee26:7:19491)

This is really causing a lot of problems for my players, how do I fix it?

Since you can reproduce it locally, I would recommend trying it with a development build and with full exceptions enabled. Those options will give you a better call stack and a better chance to debug the problem.

I’m actually hitting this same issue with a WebGL build. Flipping over to Development shows the crash is actually happening in ‘UnityEngine.Networking.UnityWebRequest.InternalBegin’ with an InvalidOperationException(null). This is stemming from the downloading of AssetBundles using the ‘UnityWebRequest.GetAssetBundle’ call. The first time I run the build (with a clean cache), I’ll never hit this. But if I reload the page, it’ll successfully pull down the base manifest, but any calls to GetAssetBundle that use the manifest’s GetAssetBundleHash will trigger this exception.

I made these changes to your AssetBundleManager code - so this should be an easy way to repro. The line that’s actually triggering it had the original WWW version:
“download = [WWW.LoadFromCacheOrDownload(url](http://WWW.LoadFromCacheOrDownload(url), m_AssetBundleManifest.GetAssetBundleHash(assetBundleName), 0);”

and is now:
“download = UnityWebRequest.GetAssetBundle(url, m_AssetBundleManifest.GetAssetBundleHash(assetBundleName), 0);”
…with all other required changes (WWW to UnityWebRequests, etc)

This all works fine going back to WWW, but we’d like to use UnityWebRequest, as is advised in your best practices documentation for streaming asset bundles.

Any chance you could submit a bug report with a repro project? That would save as a bit of time.

Was this ever addressed / bugged - I didn’t see anything and opened a bug without an attached project. :confused:
This only occurs on browser, and was 100% with non-private Safari using a local webgl build. This prevents us from using the built in decompressed caching.
Using UnityWebRequest.GetAssetBundle(url).Send(); works, most assets 304 properly
UnityWebRequest.GetAssetBundle(url, version, crc).Send(); fails - there is no resource request.

Hello, we have the same error, and it occurred after we tried to launch on facebook. We are using asset bundles.
But this error shows only one time on each pc we tested. We couldn’t reproduce it.