Skip to content

Remove Debug.Assert calls in production or hide them behind settings. #472

Closed
@JimmyDeemo

Description

@JimmyDeemo

Debug.Assert calls are causing SecurityExceptions when invoked from other SDKs. Please can we remove them from the release or hid them behind compilation flags or settings?

SecurityException: Couldn't impersonate token.
System.Security.Principal.WindowsImpersonationContext..ctor (System.IntPtr token) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Security.Principal.WindowsIdentity.Impersonate (System.IntPtr userToken) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Configuration.ClientConfigurationHost.Impersonate () (at <a1ce1c69645646719db9dfa57cf6b99c>:0)
System.Configuration.BaseConfigurationRecord.Impersonate () (at <a1ce1c69645646719db9dfa57cf6b99c>:0)
System.Configuration.BaseConfigurationRecord.InitConfigFromFile () (at <a1ce1c69645646719db9dfa57cf6b99c>:0)
Rethrow as ConfigurationErrorsException: An error occurred loading a configuration file: Couldn't impersonate token.
System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors (System.Boolean ignoreLocal) (at <a1ce1c69645646719db9dfa57cf6b99c>:0)
System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors (System.Configuration.ConfigurationSchemaErrors schemaErrors) (at <a1ce1c69645646719db9dfa57cf6b99c>:0)
System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors () (at <a1ce1c69645646719db9dfa57cf6b99c>:0)
System.Configuration.ClientConfigurationSystem.EnsureInit (System.String configKey) (at <a1ce1c69645646719db9dfa57cf6b99c>:0)
Rethrow as ConfigurationErrorsException: Configuration system failed to initialize
System.Configuration.ClientConfigurationSystem.EnsureInit (System.String configKey) (at <a1ce1c69645646719db9dfa57cf6b99c>:0)
System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem (System.String sectionName) (at <a1ce1c69645646719db9dfa57cf6b99c>:0)
System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String sectionName) (at <a1ce1c69645646719db9dfa57cf6b99c>:0)
System.Configuration.ConfigurationManager.GetSection (System.String sectionName) (at <a1ce1c69645646719db9dfa57cf6b99c>:0)
System.Configuration.PrivilegedConfigurationManager.GetSection (System.String sectionName) (at <ef151b6abb5d474cb2c1cb8906a8b5a4>:0)
System.Diagnostics.DiagnosticsConfiguration.GetConfigSection () (at <ef151b6abb5d474cb2c1cb8906a8b5a4>:0)
System.Diagnostics.DiagnosticsConfiguration.Initialize () (at <ef151b6abb5d474cb2c1cb8906a8b5a4>:0)
System.Diagnostics.DiagnosticsConfiguration.get_IndentSize () (at <ef151b6abb5d474cb2c1cb8906a8b5a4>:0)
System.Diagnostics.TraceInternal.InitializeSettings () (at <ef151b6abb5d474cb2c1cb8906a8b5a4>:0)
System.Diagnostics.TraceInternal.get_UseGlobalLock () (at <ef151b6abb5d474cb2c1cb8906a8b5a4>:0)
System.Diagnostics.TraceInternal.Fail (System.String message) (at <ef151b6abb5d474cb2c1cb8906a8b5a4>:0)
System.Diagnostics.TraceInternal.Assert (System.Boolean condition) (at <ef151b6abb5d474cb2c1cb8906a8b5a4>:0)
System.Diagnostics.Debug.Assert (System.Boolean condition) (at <ef151b6abb5d474cb2c1cb8906a8b5a4>:0)
Google.VersionHandlerImpl+FileMetadataByVersion.Add (Google.VersionHandlerImpl+FileMetadata metadata) (at Z:/tmp/tmp.2frsAlF4aX/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/VersionHandlerImpl.cs:994)
Google.VersionHandlerImpl+FileMetadataSet.Add (System.String filenameCanonical, Google.VersionHandlerImpl+FileMetadataByVersion metadataByVersion) (at Z:/tmp/tmp.2frsAlF4aX/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/VersionHandlerImpl.cs:1317)
Google.VersionHandlerImpl+FileMetadataSet.ConsolidateManifests () (at Z:/tmp/tmp.2frsAlF4aX/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/VersionHandlerImpl.cs:1508)
Google.VersionHandlerImpl+ManifestReferences.FindAndReadManifestsByPackageName (Google.VersionHandlerImpl+FileMetadataSet metadataSet) (at Z:/tmp/tmp.2frsAlF4aX/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/VersionHandlerImpl.cs:1906)
Google.VersionHandlerImpl+ManifestReferences.FindAndReadManifests () (at Z:/tmp/tmp.2frsAlF4aX/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/VersionHandlerImpl.cs:1953)
Firebase.Editor.Measurement.get_BaseQuery () (at Z:/tmp/tmp.J0ijfhPZ17/firebase/app/client/unity/editor/src/Measurement.cs:55)
Firebase.Editor.Measurement..cctor () (at Z:/tmp/tmp.J0ijfhPZ17/firebase/app/client/unity/editor/src/Measurement.cs:38)
Rethrow as TypeInitializationException: The type initializer for 'Firebase.Editor.Measurement' threw an exception.
Firebase.Editor.AndroidSettingsChecker..cctor () (at Z:/tmp/tmp.J0ijfhPZ17/firebase/app/client/unity/editor/src/AndroidAPILevelChecker.cs:37)
Rethrow as TypeInitializationException: The type initializer for 'Firebase.Editor.AndroidSettingsChecker' threw an exception.
System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Activator.CreateInstance (System.Type type) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
UnityEditor.AssetPostprocessingInternal.GetTextureProcessorsHashString () (at <a259d3c004024353a2c217da97495055>:0)
UnityEditor.AssetDatabase:Refresh()

GooglePlayGames.Editor.GPGSUpgrader:.cctor() (at Assets/GooglePlayGames/Editor/GPGSUpgrader.cs:104)​
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes(Type[])

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions