cadon / ARKStatsExtractor

A tool for the game ARK: Survival Evolved. Extracts possible levelups of creatures to get the values for breeding. With library and pedigree-view.
MIT License
481 stars 248 forks source link

Speech recognition prevents app from loading under mono (linux) #237

Open TheFeshy opened 7 years ago

TheFeshy commented 7 years ago

Loading the app in mono with --verify-all crashes with the following error:

System.TypeLoadException: Error verifying ARKBreedingStats.Form1:Form1_Load (object,System.EventArgs): Could not load type ARKBreedingStats.SpeechRecognition at 0x0740
  at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x00022] in <e37081a3704b4473a59cdf5048ad96bc>:0 
  at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e) [0x00029] in <e37081a3704b4473a59cdf5048ad96bc>:0 

without verify-all the error is:

System.TypeLoadException: Could not load type 'ARKBreedingStats.SpeechRecognition' from assembly 'ARK Smart Breeding, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
 at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x00022] in <e37081a3704b4473a59cdf5048ad96bc>:0 
 at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e) [0x00029] in <e37081a3704b4473a59cdf5048ad96bc>:0 
cadon commented 7 years ago

Hi, it seems the speech-recognition is not supported in mono, as it's using parts of the .NET-environment that are not available in mono.

Did you ever enable the speech-recognition in the settings or did this error appear from its own? If you enabled it, you could disable it manually by editing the settings-file of the tool, which should be somewhere at ~/.local/share/ on your computer (look for a folder named StatsExtractor or similar). There's a file that contains all settings. Carefully look for the speech-recognition and change the value to false.

TheFeshy commented 7 years ago

The error appeared on its own when I upgraded from 0.21.4 to 0.22.2. The user.config file did not appear to contain any speech recognition related values, so I wasn't able to change them. Removing the file caused the program to crash with the same change, and not regenerate a new config.

cadon commented 7 years ago

Mono doesn't seem to support the speechrecognition modul. I'll see if I can add a check to prevent a crash.

TheFeshy commented 7 years ago

I just wanted to say that this is still an issue as of 0.23.9.

cadon commented 7 years ago

Hi, sorry for not fixing this yet. I haven't found a way to check programmatically if a library is available or not, which would be the easiest way to fix this. Currently the only way I can think of is to manually remove the speech-recognition-class from the application and recompile it anew. If I cannot find another solution, I might do this, but probably not for every release.

cadon commented 7 years ago

I might have found a solution. I'll include it in the next release, I'll let you know when it's released.

cadon commented 7 years ago

Hi, I released a new version that may solve this, but I wasn't able to test it.

Red-Pyramid commented 7 years ago

Tested with the latest release 0.23.11. Error is still present. When launched with mono:

System.TypeLoadException: Could not load type of field 'ARKBreedingStats.SpeechRecognition:recognizer' (2) due to: Could not load file or assembly 'System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. assembly:System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type:<unknown type> member:<none> at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x0001f] in <a98ec586cd3441aeb3d7919d9ad41ff2>:0 at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e) [0x00023] in <a98ec586cd3441aeb3d7919d9ad41ff2>:0

And with mono --verify-all:

System.TypeLoadException: Error verifying ARKBreedingStats.Form1:Form1_Load (object,System.EventArgs): Could not load type ARKBreedingStats.SpeechRecognition at 0x079f at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x0001f] in <a98ec586cd3441aeb3d7919d9ad41ff2>:0 at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e) [0x00023] in <a98ec586cd3441aeb3d7919d9ad41ff2>:0

cadon commented 7 years ago

Thanks for the feedback. I'll see if I can fix it in another way.

hudi1 commented 7 years ago

I tried to remove speech from the program and run it under ubuntu with mono but it seems UI is now broken too: statextractor so I dont think it is possible to use this application under linux anymore

rubensayshi commented 7 years ago

@hudi1 if you edit the code to remove the SpeechRecognition (~2min of work), compile it with mono and then run it with Wine it works ;)

hudi1 commented 7 years ago

hm I did not tried it with wine. I just tried it with mono an UI seem broken. But I will try it thx for tip

lineber commented 6 years ago

It's been nearly a year since the last update. Has anyone got this working with wine? Crossover? Or is there SpeechRecognition in mono now?

TheFeshy commented 5 years ago

I have gotten the current version working under wine, without having to remove/recompile anything. To do so, create a new 32-bit wine prefix

WINEPREFIX=yourprefix WINEARCH=32 wineboot -u

Then using winetricks install .net, ole32, and gdi

WINEPREFIX=yourprefix WINARCH=win32 winetricks dotnet472 ole32 gdiplus

You should be able to run it using this prefix now.

I am still missing unicode symbols for some things like gender. I don't know what fonts I have to install to fix that, but it's not included in "allfonts" installed by wine tricks. At least it works though.