quickstart-unity icon indicating copy to clipboard operation
quickstart-unity copied to clipboard

[Bug] EntryPointNotFoundException: GetModuleFileName

Open JimmyDeemo opened this issue 4 years ago • 14 comments

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2019.4.24f1
  • Firebase Unity SDK version: 8.0.0
  • Source you installed the SDK: .unitypackage (.unitypackage or Unity Package Manager)
  • Problematic Firebase Component: Editor (Auth, Database, etc.)
  • Other Firebase Components in use: Analytics (Auth, Database, etc.)
  • Additional SDKs you are using: Many. GPG, Facebook, Mopub, Helpshift, Pushwoosh. (Facebook, AdMob, etc.)
  • Platform you are using the Unity editor on: Mac (Mac, Windows, or Linux)
  • Platform you are targeting: iOS, Android, Amazon (iOS, Android, and/or desktop)
  • Scripting Runtime: IL2CPP (Mono, and/or IL2CPP)

[REQUIRED] Please describe the issue here:

Whenever an asset is refreshed the Firebase SDK tries to call GenerateXmlFromGoogleServicesJson which eventually results an EntryPointNotFoundException: GetModuleFileName.

Steps to reproduce:

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? No. What's the issue repro rate? (eg 100%, 1/5 etc) In my project I get multiple errors whenever I build the project.

What happened? How can we make the problem occur? This will occur just building my project. I have attached the exception stack to the ticket.

The project is a commercial project and i'm unable to reproduce with the samples. If you could give me some indicators as what it might be then I could try and get it to happen in the samples. Right now, I just don't understand the error.

EntryPointNotFoundException.txt

JimmyDeemo avatar Oct 01 '21 15:10 JimmyDeemo

Hi @JimmyDeemo,

This is a rather unusual issue. Could you try if updating the SDK and Unity editor resolves the issue? If it doesn't please provide a minimal, reproducible example of your project so that we can identify what's causing this.

paulinon avatar Oct 05 '21 06:10 paulinon

Hi @paulinon ,

I am unable to update the editor, as we are a live commercail product currently locked to the 2019 LTS versions of Unity. I am in the process of trying it in the latest release but I get the same error on first inspection. I also get this on project load.

Job failed with exception: System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.EntryPointNotFoundException: GetModuleFileName
  at (wrapper managed-to-native) Microsoft.Win32.UnsafeNativeMethods.GetModuleFileName(System.Runtime.InteropServices.HandleRef,System.Text.StringBuilder,int)
  at System.Configuration.ClientConfigPaths..ctor (System.String exePath, System.Boolean includeUserConfig) [0x00114] in <a1ce1c69645646719db9dfa57cf6b99c>:0 
  at System.Configuration.ClientConfigPaths.GetPaths (System.String exePath, System.Boolean includeUserConfig) [0x0001a] in <a1ce1c69645646719db9dfa57cf6b99c>:0 
  at System.Configuration.ClientConfigurationHost.get_ConfigPaths () [0x00008] in <a1ce1c69645646719db9dfa57cf6b99c>:0 
  at System.Configuration.ClientConfigurationHost.GetStreamName (System.String configPath) [0x000ad] in <a1ce1c69645646719db9dfa57cf6b99c>:0 
  at System.Configuration.ClientConfigurationHost.get_IsAppConfigHttp () [0x00000] in <a1ce1c69645646719db9dfa57cf6b99c>:0 
  at System.Configuration.ClientConfigurationSystem..ctor () [0x0006a] in <a1ce1c69645646719db9dfa57cf6b99c>:0 
  at System.Configuration.ConfigurationManager.EnsureConfigurationSystem () [0x00022] in <a1ce1c69645646719db9dfa57cf6b99c>:0 
   --- End of inner exception stack trace ---
  at System.Configuration.ConfigurationManager.EnsureConfigurationSystem () [0x00063] in <a1ce1c69645646719db9dfa57cf6b99c>:0 
  at System.Configuration.ConfigurationManager.PrepareConfigSystem () [0x0000a] in <a1ce1c69645646719db9dfa57cf6b99c>:0 
  at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x0000a] in <a1ce1c69645646719db9dfa57cf6b99c>:0 
  at System.Configuration.PrivilegedConfigurationManager.GetSection (System.String sectionName) [0x00000] in <ef151b6abb5d474cb2c1cb8906a8b5a4>:0 
  at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection () [0x00000] in <ef151b6abb5d474cb2c1cb8906a8b5a4>:0 
  at System.Diagnostics.DiagnosticsConfiguration.Initialize () [0x0002a] in <ef151b6abb5d474cb2c1cb8906a8b5a4>:0 
  at System.Diagnostics.DiagnosticsConfiguration.get_IndentSize () [0x00000] in <ef151b6abb5d474cb2c1cb8906a8b5a4>:0 
  at System.Diagnostics.TraceInternal.InitializeSettings () [0x0004e] in <ef151b6abb5d474cb2c1cb8906a8b5a4>:0 
  at System.Diagnostics.TraceInternal.get_UseGlobalLock () [0x00000] in <ef151b6abb5d474cb2c1cb8906a8b5a4>:0 
  at System.Diagnostics.TraceInternal.Fail (System.String message) [0x00000] in <ef151b6abb5d474cb2c1cb8906a8b5a4>:0 
  at System.Diagnostics.TraceInternal.Assert (System.Boolean condition) [0x00004] in <ef151b6abb5d474cb2c1cb8906a8b5a4>:0 
  at System.Diagnostics.Debug.Assert (System.Boolean condition) [0x00000] in <ef151b6abb5d474cb2c1cb8906a8b5a4>:0 
  at Google.VersionHandlerImpl+FileMetadataByVersion.Add (Google.VersionHandlerImpl+FileMetadata metadata) [0x00000] in Z:\tmp\tmp.2frsAlF4aX\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\VersionHandlerImpl.cs:994 
  at Google.VersionHandlerImpl+FileMetadataSet.Add (System.String filenameCanonical, Google.VersionHandlerImpl+FileMetadataByVersion metadataByVersion) [0x00022] in Z:\tmp\tmp.2frsAlF4aX\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\VersionHandlerImpl.cs:1317 
  at Google.VersionHandlerImpl+FileMetadataSet.ConsolidateManifests () [0x00119] in Z:\tmp\tmp.2frsAlF4aX\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\VersionHandlerImpl.cs:1508 
  at Google.VersionHandlerImpl+ManifestReferences.FindAndReadManifestsByPackageName (Google.VersionHandlerImpl+FileMetadataSet metadataSet) [0x00000] in Z:\tmp\tmp.2frsAlF4aX\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\VersionHandlerImpl.cs:1906 
  at Google.VersionHandlerImpl+ManifestReferences.FindAndReadManifests (Google.VersionHandlerImpl+FileMetadataSet metadataSet) [0x00000] in Z:\tmp\tmp.2frsAlF4aX\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\VersionHandlerImpl.cs:1896 
  at Google.VersionHandlerImpl.UpdateVersionedAssetsOnMainThread (System.Boolean forceUpdate, System.Action complete, System.Boolean setCleanupFilesPending) [0x0005f] in Z:\tmp\tmp.2frsAlF4aX\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\VersionHandlerImpl.cs:2830 
  at Google.VersionHandlerImpl+<UpdateVersionedAssets>c__AnonStorey1.<>m__0 () [0x00000] in Z:\tmp\tmp.2frsAlF4aX\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\VersionHandlerImpl.cs:2796 
  at Google.RunOnMainThread.ExecuteNext () [0x0003d] in Z:\tmp\tmp.2frsAlF4aX\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\RunOnMainThread.cs:486 

I understand that ideally you need a minimal repro in order to try and address this but I don't know what is causing it. Can you help me understand what this part of the code is doing such that I can try and figure out a repro project? I notice from the above callstack that it is trying to call something from Microsoft.Win32 package, which I won't have on MacOS. Also as this is from a debug assert, is there any way to integrate a version of the sdk where asserts are not used?

Please please help me to understand this error more and I will try and get you a repro project.

JimmyDeemo avatar Oct 06 '21 12:10 JimmyDeemo

Hi @JimmyDeemo,

Based on the logs you provided, this is likely caused by the resolver. With that, could you try if using the latest version of the Firebase SDK (8.3.0) makes a difference?

paulinon avatar Oct 07 '21 15:10 paulinon

Hey @JimmyDeemo. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Oct 14 '21 01:10 google-oss-bot

@paulinon Updating to 8.3.0 did not make a difference. I have another error stack, this time from a windows machine. Does it shed any light on the issue?

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 /Users/chkuang/Workspace/git/unity-jar-resolver/source/VersionHandlerImpl/src/VersionHandlerImpl.cs:994)
Google.VersionHandlerImpl+FileMetadataSet.Add (System.String filenameCanonical, Google.VersionHandlerImpl+FileMetadataByVersion metadataByVersion) (at /Users/chkuang/Workspace/git/unity-jar-resolver/source/VersionHandlerImpl/src/VersionHandlerImpl.cs:1317)
Google.VersionHandlerImpl+FileMetadataSet.ConsolidateManifests () (at /Users/chkuang/Workspace/git/unity-jar-resolver/source/VersionHandlerImpl/src/VersionHandlerImpl.cs:1508)
Google.VersionHandlerImpl+ManifestReferences.FindAndReadManifestsByPackageName (Google.VersionHandlerImpl+FileMetadataSet metadataSet) (at /Users/chkuang/Workspace/git/unity-jar-resolver/source/VersionHandlerImpl/src/VersionHandlerImpl.cs:1906)
Google.VersionHandlerImpl+ManifestReferences.FindAndReadManifests () (at /Users/chkuang/Workspace/git/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.GenerateXmlFromGoogleServicesJson.RunResourceGenerator (System.Collections.Generic.IEnumerable`1[T] arguments, System.String inputPath, System.Boolean showCommandLine) (at Z:/tmp/tmp.J0ijfhPZ17/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:523)
Firebase.Editor.GenerateXmlFromGoogleServicesJson.ReadBundleIds (System.String googleServicesFile) (at Z:/tmp/tmp.J0ijfhPZ17/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:407)
Firebase.Editor.GenerateXmlFromGoogleServicesJson.UpdateConfigFileDirectory () (at Z:/tmp/tmp.J0ijfhPZ17/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:295)
Firebase.Editor.GenerateXmlFromGoogleServicesJson.CheckConfiguration () (at Z:/tmp/tmp.J0ijfhPZ17/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:246)
Firebase.Editor.GenerateXmlFromGoogleServicesJson.<GenerateXmlFromGoogleServicesJson>m__1 () (at Z:/tmp/tmp.J0ijfhPZ17/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:103)
Google.EditorInitializer+<InitializeOnMainThread>c__AnonStorey1.<>m__2 () (at /Users/chkuang/Workspace/git/unity-jar-resolver/source/VersionHandlerImpl/src/EditorInitializer.cs:60)

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.InitPostprocessors (UnityEditor.Experimental.AssetImporters.AssetImportContext context, System.String pathName) (at <a259d3c004024353a2c217da97495055>:0)
UnityEditor.AssetPostprocessingInternal:InitPostprocessors(AssetImportContext, String)

Seems to stem from Firebase.Editor.AndroidSettingsChecker.

JimmyDeemo avatar Oct 14 '21 08:10 JimmyDeemo

Thanks for providing more information, @JimmyDeemo. It would be great if you can provide a minimal, reproducible example of your project so that we can have a better analysis on why this behavior occurs.

paulinon avatar Oct 15 '21 05:10 paulinon

I can try but the thing is that this is a commercial project and I can't just hand it over. I will try and strip back everything to get a copy of the project that does it. Alternatively, expediting this issue will help me; https://github.com/googlesamples/unity-jar-resolver/issues/472.

I am on vacation next week so I would appreciate it if the bot didn't close this ticket until at least two weeks.

JimmyDeemo avatar Oct 15 '21 11:10 JimmyDeemo

Hey @JimmyDeemo. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Oct 22 '21 01:10 google-oss-bot

Hey @JimmyDeemo. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Oct 29 '21 01:10 google-oss-bot

I am still working on providing a repro project for this issue. Please can you keep the ticket open a little while longer.

JimmyDeemo avatar Oct 31 '21 18:10 JimmyDeemo

@paulinon I have a small repro project that has been stripped of company references and code, please may I have an e-mail address to send it to you?

JimmyDeemo avatar Nov 04 '21 11:11 JimmyDeemo

Hi @JimmyDeemo, you may share this with [email protected].

paulinon avatar Nov 05 '21 09:11 paulinon

@paulinon Thank you. You should have a Send Safely link in that inbox. Please confirm.

Repro steps are to load the project in either 2019 or 2020 LTS versions. You should see the error somwhere in the console. Likewise if you go to any script, right click re-import, it will generate another error.

JimmyDeemo avatar Nov 05 '21 12:11 JimmyDeemo

I have found that if I remove the SQLite folder from the project that the error message stops occuring.

JimmyDeemo avatar Nov 09 '21 12:11 JimmyDeemo