Artentus / ModMyFactory2

Rewrite of ModMyFactory, the Factorio mod manager
GNU General Public License v3.0
55 stars 18 forks source link

App crashes on launch if it loads a managed Factorio instance or modpacks.json MacOS 12.1 #45

Closed willwill2will54 closed 2 years ago

willwill2will54 commented 2 years ago

Whenever I try to start the manager, if I have managed to manually create a managed install (as the download/import process is separately broken) or if I have not deleted the modpacks.json file, the app immediately crashes.

It appears that you are running into the 'only main thread does UI' limitation placed on cocoa apps, but I don't know why this is only an issue with a loaded factorio instance or modpacks file.

Find the verbose log below

willcharlton@Wills-MacBook-Pro .modmyfactorygui % /Users/willcharlton/Downloads/4/ModMyFactoryGUI run -v
[23:25:07 INF] Operating system: Darwin 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64
[23:25:07 INF] Runtime: .NET 5.0.5
[23:25:08 INF] GUI version: 4.3.0.34-beta
[23:25:08 INF] Using ModMyFactory v1.4.0.75
[23:25:08 INF] Using ModMyFactory.BaseTypes v1.2.1.23
[23:25:08 INF] Using ModMyFactory.Export v1.4.0.29
[23:25:08 INF] Using ModMyFactory.Localization v1.1.0.9-alpha
[23:25:08 INF] Using ModMyFactory.ModSettings v1.2.0.21-alpha
[23:25:08 INF] Using ModMyFactory.WebApi v1.2.0.34
[23:25:08 INF] Using ModMyFactory.Win32 v1.1.0.15
[23:25:08 VRB] Application directory: /Users/willcharlton/Downloads/4
[23:25:08 VRB] Data directory: /Users/willcharlton/.modmyfactorygui
[23:25:08 DBG] Settings loaded:
    factorio_location: #appdata
    mod_location: #appdata
    language: en
    theme: BaseLight
    update_on_startup: True
    update_prerelease: False
    window_restore_state: 100;72;2256;1167
    manager_grid_length_1: 1*
    manager_grid_length_2: 1*
    online_grid_length_1: 1*
    online_grid_length_2: 1*
    online_sub_grid_length_1: 1*
    online_sub_grid_length_2: 1*
    window_maximized: False
[23:25:08 VRB] Unable to load Factorio Steam instance
[23:25:08 VRB] Successfully loaded managed Factorio instance from 'someFolder'
[23:25:08 VRB] No mopack file found, skipping import
[23:25:08 ERR] Application crashed
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidOperationException: Call from invalid thread
   at Avalonia.Threading.Dispatcher.VerifyAccess()
   at Avalonia.AvaloniaObject.VerifyAccess()
   at Avalonia.AvaloniaObject..ctor()
   at Avalonia.Application..ctor()
   at ModMyFactoryGUI.App..ctor() in C:\projects\modmyfactory-gui\ModMyFactoryGUI\App.xaml.cs:line 47
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
   at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
   at System.Activator.CreateInstance[T]()
   at Avalonia.Controls.AppBuilderBase`1.<>c__45`1.<Configure>b__45_0()
   at Avalonia.Controls.AppBuilderBase`1.Setup()
   at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
   at ModMyFactoryGUI.Program.StartAppAsync(String[] args, RunOptions options) in C:\projects\modmyfactory-gui\ModMyFactoryGUI\Program.cs:line 378
[23:25:08 INF] Saving settings...
[23:25:08 DBG] Settings saved to '/Users/willcharlton/.modmyfactorygui/settings.json'
[23:25:08 INF] Shutting down
Artentus commented 2 years ago

Unfortunately I am unable to support Mac at all. I included a Mac build initially because I was under the impression it was similar enough to Linux and it compiled so I might as well.
But turns out it is in fact quite different to Linux. The Mac build is completely non-functional and without actually buying a Mac I have no way of making it work. So from now on I will stop providing Mac builds altogether, they are just misleading.