-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
真机报can not load type #313
Comments
你生成补丁的环境和手机上的.net不一样。生成补丁用的是netstandard2.0,手机不是 |
我打包用的Unity和生成补丁文件的Unity设置的.net都是2.0版本的,另一个项目用的2019.4的Unity版本同样用2.0来生成补丁和打包测试就没有报这种问题,用的同一台手机测试 |
看你说得就不太专业 netstandard2.0 比.net 4.0版本都要高很多。 |
我用来打包和生成补丁的Unity的设置都是默认的,同一份配置,应该都是.NET Standard 2.0 |
或者就是被剪裁了 |
以can not load type[System.string, netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]为例Unity2020.3的项目里面ApiCompatibilityLevel如果设置的是standard 2.0,那参数string就会是netstandard, Version=2.0.0.0的,在 |
切换到.net 版本是在PlayerSettings里面有一个: api compatibility level* 里,选择.net4x。
…------------------ 原始邮件 ------------------
发件人: "Tencent/InjectFix" ***@***.***>;
发送时间: 2022年8月1日(星期一) 下午4:51
***@***.***>;
***@***.***>;
主题: Re: [Tencent/InjectFix] 真机报can not load type (#313)
请问下如何修改managedStrippingLevel的设置呢?我用的Unity2021,也出现这个问题了。Unity里面不是只有这几个选项吗?怎么改到 .net 版本的呢?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
我以为可以针对2.1不裁剪呢,目前我也是改成先不用2.1了 |
unity 2021.3.21遇到相同问题 补充:设置成不裁切没有用,只有设置成.NET Framework才行 |
link.xml <linker>
<assembly fullname="IFix.Core" preserve="all" />
<assembly fullname="Assembly-CSharp">
<type fullname="IFIX.WrappersManagerImpl" preserve="all" />
<type fullname="IFix.ILFixInterfaceBridge" preserve="all" />
<type fullname="IFix.IDMAP0" preserve="all" />
</assembly>
<assembly fullname="UnityEngine" preserve="all" />
<assembly fullname="UnityEngine.UI" preserve="all" />
<assembly fullname="netstandard" preserve="all"/>
</linker> 我們嘗試過使用 link.xml 來避免 netstandard 被剪裁 在 2021.3 是可以的 請試試看 |
编辑器上测试没问题,打了安卓包在手机上运行PatchManager.Load 就会报can not load type,不管是修复的哪个函数都会报类似这种can not load type [System.Collections.IEnumerator, netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51],括号里面的参数是根据我修复函数的参数来的,这个是修复没参数的函数时报的
还有类似这种的can not load type [System.Action`2[[UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
有没有遇到同类的问题,没啥头绪,用的2020.3版本的Unity
The text was updated successfully, but these errors were encountered: