weitianhan 发表于 2020-8-2 15:21

[Mod开发求助] Unity Mod Manager错误

本帖最后由 weitianhan 于 2020-8-2 15:22 编辑

mod区的大佬们 救救孩子吧 想自己写一些小众unity游戏的mod 但是实在不会debug UMM的错误 请大佬们帮忙看看


这个UMM在log里扔出来的错误 我实在是无能为力 我唯一能确定的是好像连我写的mod的Load方法都还没进去就出错了 因为我写在Load的里的log都没有出现

完整log我直接贴上来吧也
Initialize engine version: 2018.4.22f1 (3362ffbb7aa1)
GfxDevice: creating device client; threaded=1
Direct3D:
    Version:Direct3D 11.0
    Renderer: NVIDIA GeForce RTX 2080 (ID=0x1ed0)
    Vendor:   (null)
    VRAM:   3072 MB
    Driver:   26.21.14.4259
Begin MonoManager ReloadAssembly
- Completed reload, in0.167 seconds
<RI> Initializing input.

<RI> Input initialized.

<RI> Initialized touch support.

UnloadTime: 0.280500 ms
System.NullReferenceException: Object reference not set to an instance of an object
at GameDataEditor.GDEDataManager.LocalizeUpdate (System.String Key, System.String ValueName, System.Collections.Generic.Dictionary`2 LocalizeText) in <filename unknown>:0
at GameDataEditor.GDEDataManager.BuildDataKeysBySchemaList () in <filename unknown>:0
at GameDataEditor.GDEDataManager.InitFromText (System.String dataString) in <filename unknown>:0

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)

Load2
Unloading 5 Unused Serialized files (Serialized files now loaded: 0)

Unloading 6 unused Assets to reduce memory usage. Loaded Objects now: 6388.
Total: 13.859000 ms (FindLiveObjects: 0.243200 ms CreateObjectMapping: 0.077200 ms MarkObjects: 13.524100 msDeleteObjects: 0.014200 ms)

No Playlist Controllers exist in the Scene. Music will not play.
Setting
MaximizedWindow is not currently supported on Windows, setting to FullsceenWindow instead

(Filename:Line: 295)

Unloading 5 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 1.690000 ms
More than one Master Audio prefab exists in this Scene. Destroying the newer one called 'SoundManager'. You may wish to set up a Bootstrapper Scene so this does not occur.


Injection...
Initialize.
Version: '0.17.0.0'.
OS: Microsoft Windows NT 10.0.18363.0 x86.
Game: 超时空方舟(Chrono Ark).
Parsing mods.
Reading file 'C:\Program Files (x86)\Steam\steamapps\common\Chrono Ark\Mods\doubledamage\Info.json'.
Sorting mods.
Loading mods.
To skip (disabled).
FINISH. SUCCESSFUL LOADED 1/1 MODS.


Checking for updates.
No network connection or firewall blocked.

Unloading 56 unused Assets to reduce memory usage. Loaded Objects now: 6370.
Total: 15.470100 ms (FindLiveObjects: 0.293700 ms CreateObjectMapping: 0.096200 ms MarkObjects: 14.978900 msDeleteObjects: 0.100800 ms)

Unloading 2 Unused Serialized files (Serialized files now loaded: 0)

Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 6370.
Total: 15.181500 ms (FindLiveObjects: 0.280000 ms CreateObjectMapping: 0.079800 ms MarkObjects: 14.812700 msDeleteObjects: 0.008700 ms)

版本'1.0.0'. Loading.
[错误] 加载'C:\Program Files (x86)\Steam\steamapps\common\Chrono Ark\Mods\doubledamage\doubledamage.dll'时出错.
[其他] ReflectionTypeLoadException - The classes in the module cannot be loaded.
System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () in <filename unknown>:0
at UnityModManagerNet.UnityModManager+ModEntry.Load () in <filename unknown>:0
Loading time 0.01 s.


weitianhan 发表于 2020-8-4 16:48

感谢版主帮忙高亮 其实原贴的问题我已经找到问题了 是我在创建项目选目标框架的时候选成了.NET CORE 但是现在又遇到了新问题了 具体是这样的
Initialize engine version: 2018.4.22f1 (3362ffbb7aa1)
GfxDevice: creating device client; threaded=1
Direct3D:
    Version:Direct3D 11.0
    Renderer: NVIDIA GeForce RTX 2080 (ID=0x1ed0)
    Vendor:   (null)
    VRAM:   3072 MB
    Driver:   26.21.14.4259
Begin MonoManager ReloadAssembly
- Completed reload, in0.163 seconds
<RI> Initializing input.

<RI> Input initialized.

<RI> Initialized touch support.

UnloadTime: 0.268500 ms
System.NullReferenceException: Object reference not set to an instance of an object
at GameDataEditor.GDEDataManager.LocalizeUpdate (System.String Key, System.String ValueName, System.Collections.Generic.Dictionary`2 LocalizeText) in <filename unknown>:0
at GameDataEditor.GDEDataManager.BuildDataKeysBySchemaList () in <filename unknown>:0
at GameDataEditor.GDEDataManager.InitFromText (System.String dataString) in <filename unknown>:0

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)

Unloading 5 Unused Serialized files (Serialized files now loaded: 0)

Unloading 6 unused Assets to reduce memory usage. Loaded Objects now: 6388.
Total: 13.882700 ms (FindLiveObjects: 0.272400 ms CreateObjectMapping: 0.088200 ms MarkObjects: 13.506600 msDeleteObjects: 0.015000 ms)

No Playlist Controllers exist in the Scene. Music will not play.
Setting
MaximizedWindow is not currently supported on Windows, setting to FullsceenWindow instead

(Filename:Line: 295)

Unloading 5 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 1.668000 ms
More than one Master Audio prefab exists in this Scene. Destroying the newer one called 'SoundManager'. You may wish to set up a Bootstrapper Scene so this does not occur.


Injection...
Initialize.
Version: 0.21.2.0.
OS: Microsoft Windows NT 10.0.18363.0 x86.
Net Framework: 2.0.50727.1433.
Unity Engine: 2018.4.221.
Game: 超时空方舟(Chrono Ark).
Mods path: C:\Program Files (x86)\Steam\steamapps\common\Chrono Ark\Mods.
Parsing mods.
Reading file 'C:\Program Files (x86)\Steam\steamapps\common\Chrono Ark\Mods\doubledmg\Info.json'.
Sorting mods.
Loading mods.
Version '1.0.0'. Loading.
[错误Error trying to call 'doubledmg.MainMod.Load'.
[例外] TargetInvocationException - Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'System.Func`3' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) in <filename unknown>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) in <filename unknown>:0
at UnityModManagerNet.UnityModManager+ModEntry.Invoke (System.String namespaceClassnameMethodname, System.Object& result, System.Object[] param, System.Type[] types) in <filename unknown>:0
Not loaded.
Loading time 0.01 s.
FINISH. SUCCESSFUL LOADED 0/1 MODS.


检测更新.
无法连接到更新服务器,请检测网络.

Unloading 56 unused Assets to reduce memory usage. Loaded Objects now: 6371.
Total: 15.150000 ms (FindLiveObjects: 0.299500 ms CreateObjectMapping: 0.090800 ms MarkObjects: 14.691400 msDeleteObjects: 0.068100 ms)

Unloading 2 Unused Serialized files (Serialized files now loaded: 0)

Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 6371.
Total: 14.997700 ms (FindLiveObjects: 0.268200 ms CreateObjectMapping: 0.078100 ms MarkObjects: 14.642100 msDeleteObjects: 0.008700 ms)


游戏编译用的unity引擎好像是2018某个版本的 理论上要用.NET FRAMEWORK 4.0来写umm mod 但是游戏Managed文件夹下包含了一个mscorlib.dll用的是2.0.0.0的版本 有可能就直接导致了这个错误 具体我也不知道= =
也尝试如果用低于.NET FRAMEWORK 4.0的版本 比如3.5来编译mod 那么会报错说.NET版本不支持 因为UnityEngine UnityModManager等等等等东西都对mscorlib (version = 4.0.0.0)有依赖关系
我遇到的问题其实跟umm github下的一个issue是一模一样的 可是参考了那个人贴的stackoverflow问题链接 感觉根本没找到解决方案= =
https://github.com/newman55/unity-mod-manager/issues/30
我上网搜了一下mono好像是会包括一个微型的.NET环境 但是怎么办呢 由于本人对Unity引擎和Mono之类的知识为0 还是那句话 大佬们 救救孩子吧
页: [1]
查看完整版本: [Mod开发求助] Unity Mod Manager错误