OpenRA / d2

A d2 mod for OpenRA
GNU General Public License v3.0
58 stars 20 forks source link

Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown #140

Open fusion809 opened 5 years ago

fusion809 commented 5 years ago

Hi,

When launching the AppImage for commit 2b37e3571355a930b781979ea5b9c18b6297fbaf I get the exception:

Exception of type `System.Reflection.ReflectionTypeLoadException`: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
Could not resolve type with token 010000a8 from typeref (expected class 'OpenRA.Traits.ResourceTypeInfo' in assembly 'OpenRA.Game, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null')
Could not resolve type with token 010000a8 from typeref (expected class 'OpenRA.Traits.ResourceTypeInfo' in assembly 'OpenRA.Game, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null')
Could not resolve type with token 010001dd from typeref (expected class 'OpenRA.Activities.CompositeActivity' in assembly 'OpenRA.Game, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null')
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

Here's a zip archive for all the relevant logs (only the exception log exists, all others are empty): logs-20190703-d2.zip.

evgeniysergeev commented 5 years ago

Hello, @fusion809, Is this reproduced on latest code?

fusion809 commented 5 years ago

Yep, I'm afraid so.

GraionDilach commented 5 years ago

AppImages built upon the last release requires a proper Mono framework upon the system.

146 has been merged though so I really try for a reproduction, since that bumped everything to playtest.

fusion809 commented 5 years ago

Seems unlikely to be the cause, as I can run Dune II without a problem using ./launch-game.sh, after manually compiling it. I can also run it from my AUR package of it. Likewise, I can run Red Alert, Dune 2K and Tiberian Dawn AppImages built on this system from the latest commits of the upstream OpenRA repo (https://github.com/OpenRA/OpenRA).

GraionDilach commented 5 years ago

Yes, you're correct with that not being the cause - just found it here:

https://github.com/OpenRA/d2/blob/0a74333011044263084f9e714035200fbb676fd7/OpenRA.Mods.D2/Widgets/D2SpriteWidget.cs#L14

@evgeniysergeev Upstream removed System.Drawing usage because that lead to a lot of dependencies required to be integrated into the AppImage and the crash is caused by this. You need to follow suit, https://github.com/OpenRA/OpenRA/pull/15973 gives you the examples to look at.

evgeniysergeev commented 5 years ago

Yes, you're correct with that not being the cause - just found it here:

https://github.com/OpenRA/d2/blob/0a74333011044263084f9e714035200fbb676fd7/OpenRA.Mods.D2/Widgets/D2SpriteWidget.cs#L14

@evgeniysergeev Upstream removed System.Drawing usage because that lead to a lot of dependencies required to be integrated into the AppImage and the crash is caused by this. You need to follow suit, OpenRA/OpenRA#15973 gives you the examples to look at.

Should be fixed in #154 But this is changes only in d2 mod, not in modSdk. for modSDK waiting for https://github.com/OpenRA/OpenRAModSDK/issues/123

GraionDilach commented 5 years ago

The ModSDK issue is limited to the Windows path however and should not involve a running AppImage. So #154 should fix the crash here.

evgeniysergeev commented 5 years ago

154 merged

fusion809 commented 5 years ago

Ah, folks I hate to be a buzzkill but the AppImage issue seems to have survived. I am still getting that error.

GraionDilach commented 5 years ago

https://github.com/OpenRA/d2/blob/f2134671157bb32106a651d0a3543132bec2496b/mod.config#L137 was not updated compared to https://github.com/OpenRA/OpenRAModSDK/blob/5e1de7189d140049f91b3f88f3771b4c97f0b47a/mod.config#L137

evgeniysergeev commented 5 years ago

https://github.com/OpenRA/d2/blob/f2134671157bb32106a651d0a3543132bec2496b/mod.config#L137

was not updated compared to https://github.com/OpenRA/OpenRAModSDK/blob/5e1de7189d140049f91b3f88f3771b4c97f0b47a/mod.config#L137

This will be updated in #156

evgeniysergeev commented 5 years ago

https://github.com/OpenRA/d2/blob/f2134671157bb32106a651d0a3543132bec2496b/mod.config#L137

was not updated compared to https://github.com/OpenRA/OpenRAModSDK/blob/5e1de7189d140049f91b3f88f3771b4c97f0b47a/mod.config#L137

This will be updated in #156

156 merged

fusion809 commented 5 years ago

Sorry folks, but the error still seems to exist with the latest commit.

pchote commented 5 years ago

There seems to be several layers of problems here...

The errors reported by make check will need to be fixed before the AppImage has any chance of reliably working (hint: you are using the Mods.Cnc dll but don't tell the SDK to package it). You should also go back through the instructions in https://github.com/OpenRA/OpenRAModSDK/releases/tag/20190825 and redo the mod.config changes. Your dll whitelist definitions, in particular, are not set up correctly.

We put a lot of effort into building the make check and make test commands to automatically identify errors like this. You would save a lot of trouble by running these a regular part of your workflow and taking the time to understand what causes them.

Both the AppImage and launch-game scripts crash on startup for me because the load screen can't find IBM.PAL. The load screen and content installer must not reference any external files because users will not otherwise be able to install them!

evgeniysergeev commented 5 years ago

Waiting for #160 #161 #162

evgeniysergeev commented 5 years ago

Can we try to package and run again, after #163 will be merged

fusion809 commented 5 years ago

Sure, happy to give it a go.

evgeniysergeev commented 5 years ago

Sure, happy to give it a go.

You can test using https://github.com/evgeniysergeev/d2/tree/fix-tests branch this way you don’t need to wait for merge and we will know is that changes helps or not

fusion809 commented 5 years ago

Odd, I get this error when building the AppImage:

Installing OpenRA engine to /data/GitHub/others/d2-fork/packaging/linux/D2Mod.appdir/usr/lib/openra
Installing OpenRA common mod files to /data/GitHub/others/d2-fork/packaging/linux/D2Mod.appdir/usr/lib/openra
cp: cannot stat './mods/cnc/OpenRA.Mods.Cnc.dll': No such file or directory
fusion809 commented 5 years ago

If it helps running:

find . -name "OpenRA.Mods.Cnc.dll"

in the top level of this repo, returns:

./engine/mods/common/OpenRA.Mods.Cnc.dll
./engine/OpenRA.Mods.Cnc/obj/Release/OpenRA.Mods.Cnc.dll
./packaging/linux/D2Mod.appdir/usr/lib/openra/mods/common/OpenRA.Mods.Cnc.dll