Unity Issue Tracker - Error “MissingReferenceException: The object of type 'Unity.Services.Analytics.AnalyticsContainer' has been destroyed but you are still trying to access it.“ is present when using EndUserConsent.SetConsentState()
Fixed
UUM-132467
Error “MissingReferenceException: The object of type 'Unity.Services.Analytics.AnalyticsContainer' has been destroyed but you are still trying to access it.“ is present when using EndUserConsent.SetConsentState()
Package: UGS Analytics
Fixed
6.2.X
Analytics SDK 6.3.0 contains this fix and has now been released.
Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the “/Assets/TestScene.unity” Scene
3. Enter the Play Mode
4. Press the Button with text “Init”
5. Observe the Console
6. Press the Button with text “Enable Consent”
7. Repeat step 5
8. Exit the Play Mode
9. Enter the Play Mode
10. Repeat step 4
9. Press the Button with text “Enable Consent”
Expected result: No Errors exist
Actual result: Error “MissingReferenceException: The object of type 'Unity.Services.Analytics.AnalyticsContainer' has been destroyed but you are still trying to access it.“ is present
Reproducible with: 6000.3.5f1, 6000.4.0b5
Could not test with: 6000.0.66f1, 6000.5.0a5 (Assets\ConsentTester.cs(4,19): error CS0234: The type or namespace name 'UnityConsent' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?))
Testing environment: Windows 10 Enterprise 21H2
Not reproducible on: No other environment tested
Note:
Reproducible when pressing the Button with text “Disable Consent”
Prioritise and Follow this issue
Have a workaround or additional info about this issue?