Skip to content
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

Warning: read ./Library/ScriptAssemblies/Assembly-CSharp.dll with symbol fail #16

Closed
jackyatplusone opened this issue Sep 20, 2019 · 9 comments

Comments

@jackyatplusone
Copy link

unity 2018.4.5
报错:这个报错在HelloWorld例子中也出现
Warning: read ./Library/ScriptAssemblies/Assembly-CSharp.dll with symbol fail

自己的项目中:
Unhandled Exception:System.Exception: XXX.Utils/d__4 is CompilerGenerated
at IFix.CodeTranslator.addExternType (Mono.Cecil.TypeReference type, Mono.Cecil.TypeReference contextType) [0x00056] in :0
at IFix.CodeTranslator.addExternMethod (Mono.Cecil.MethodReference callee, Mono.Cecil.MethodDefinition caller) [0x000ba] in :0
at IFix.CodeTranslator.getMethodId (Mono.Cecil.MethodReference callee, Mono.Cecil.MethodDefinition caller, System.Boolean directCallVirtual, IFix.CodeTranslator+InjectType callerInjectType) [0x00123] in :0
at IFix.CodeTranslator.getMethodId (Mono.Cecil.MethodReference callee, Mono.Cecil.MethodDefinition caller, System.Boolean directCallVirtual, IFix.CodeTranslator+InjectType callerInjectType) [0x00f64] in :0
at IFix.CodeTranslator.addAnonymousCtor (Mono.Cecil.MethodDefinition ctor) [0x00060] in :0
at IFix.CodeTranslator.getMethodId (Mono.Cecil.MethodReference callee, Mono.Cecil.MethodDefinition caller, System.Boolean directCallVirtual, IFix.CodeTranslator+InjectType callerInjectType) [0x00deb] in :0
at IFix.CodeTranslator.getMethodId (Mono.Cecil.MethodReference callee, Mono.Cecil.MethodDefinition caller, System.Boolean directCallVirtual, IFix.CodeTranslator+InjectType callerInjectType) [0x00f64] in :0
at IFix.CodeTranslator.addAnonymousCtor (Mono.Cecil.MethodDefinition ctor) [0x00060] in :0
at IFix.CodeTranslator.getMethodId (Mono.Cecil.MethodReference callee, Mono.Cecil.MethodDefinition caller, System.Boolean directCallVirtual, IFix.CodeTranslator+InjectType callerInjectType) [0x00deb] in :0
at IFix.CodeTranslator.getMethodId (Mono.Cecil.MethodReference callee, Mono.Cecil.MethodDefinition caller, System.Boolean directCallVirtual, IFix.CodeTranslator+InjectType callerInjectType) [0x00f64] in :0
at IFix.CodeTranslator.getMethodId (Mono.Cecil.MethodReference callee, Mono.Cecil.MethodDefinition caller, System.Boolean directCallVirtual, IFix.CodeTranslator+InjectType callerInjectType) [0x00f64] in :0
at IFix.CodeTranslator.getMethodId (Mono.Cecil.MethodReference callee, Mono.Cecil.MethodDefinition caller, System.Boolean directCallVirtual, IFix.CodeTranslator+InjectType callerInjectType) [0x00f64] in :0
at IFix.CodeTranslator.processMethod (Mono.Cecil.MethodDefinition method) [0x00000] in :0
at IFix.CodeTranslator.Process (Mono.Cecil.AssemblyDefinition assembly, Mono.Cecil.AssemblyDefinition ilfixAassembly, IFix.GenerateConfigure configure, IFix.ProcessMode mode) [0x00190] in :0
at IFix.Program.Main (System.String[] args) [0x0016c] in :0

UnityEngine.Debug:LogError(Object)
IFix.Editor.IFixEditor:CallIFix(List`1) (at Assets/IFix/Editor/ILFixEditor.cs:140)
IFix.Editor.IFixEditor:InjectAssembly(String) (at Assets/IFix/Editor/ILFixEditor.cs:269)
IFix.Editor.IFixEditor:InjectAllAssemblys() (at Assets/IFix/Editor/ILFixEditor.cs:287)
IFix.Editor.IFixEditor:InjectAssemblys() (at Assets/IFix/Editor/ILFixEditor.cs:152)

配置文件

[Configure]
public class IFixConfig {
    [IFix]
    static IEnumerable<Type> ToProcess
    {
        get
        {
            return (from type in Assembly.Load("Assembly-CSharp").GetTypes()
                where type.Namespace == "XXX"
                select type).ToList();
        }
    }

}

XXX是我们自己的命名空间

@chexiongsheng
Copy link
Collaborator

这个:
Warning: read ./Library/ScriptAssemblies/Assembly-CSharp.dll with symbol fail
你把IFixToolKit下面的Mono.Cecil开头的文件用你unity配套的替换下

另外一个问题,你看看你项目是不是用async/await

@jackyatplusone
Copy link
Author

这个:
Warning: read ./Library/ScriptAssemblies/Assembly-CSharp.dll with symbol fail
你把IFixToolKit下面的Mono.Cecil开头的文件用你unity配套的替换下

另外一个问题,你看看你项目是不是用async/await

以下都是unity lts版本

  1. 使用Unity2018.4.5\Editor\Data\il2cpp\build 目录下的Mono.Cecil进行替换,仍然报错类似
    Unhandled Exception:System.Exception: XXX.Utils/d__4 is CompilerGenerated

  2. 项目中是使用了async await

3.使用unity 2017.4.32 仍然是原有项目,重新进行了编译步骤:

Window下打开源码包的Source\VSProj\build_for_unity.bat,UNITY_HOME变量的值修改为指向本机unity安装目录
运行build_for_unity.bat

,可生成 Assembly-CSharp.patch.bytes文件。但是有白色提示
WARNING: The runtime version supported by this application is unavailable

4.用unity 2017.4.32打开官方的helloworld,可生成补丁,但是也报错
WARNING: The runtime version supported by this application is unavailable

5.可以确定 Warning: read ./Library/ScriptAssemblies/Assembly-CSharp.dll with symbol fail报错和unity版本有关,替换Mono.Cecil无效,或者应该用哪个路径下的文件替换。项目中有多个同名文件。

@treert
Copy link
Contributor

treert commented Sep 25, 2019

这是个warning,dll没有对应的调试符号文件mdb。不影响运行,至少UnityEditor里的运行。

@jackyatplusone
Copy link
Author

这是个warning,dll没有对应的调试符号文件mdb。不影响运行,至少UnityEditor里的运行。

这个对解决问题没有帮助,明确一下问题,同一个项目
unity 2018.4.5 injex 直接失败,根本无法生成patch。 copy dll和mdb问题依旧。
unity 2017.4.32 可以生成patch和运行。

怀疑injex fix目前是否只测试过对2018.3.x的兼容性,而没有测试过2018.4.x?

@chexiongsheng
Copy link
Collaborator

WARNING: The runtime version supported by this application is unavailable
写着WARNING,并不是错误。另外,更新下代码这个warning也会没了

@whyUnself
Copy link

请问:Warning: read ./Library/ScriptAssemblies/Assembly-CSharp.dll with symbol fail
这个解决了吗怎么解决的。

@chexiongsheng
Copy link
Collaborator

请问:Warning: read ./Library/ScriptAssemblies/Assembly-CSharp.dll with symbol fail
这个解决了吗怎么解决的。

这个warning没啥影响

@JiayunLin
Copy link

遇到有个类里的函数都无法patch,报的是这个warning

@linkongchen
Copy link

我也有这个warning,但是依旧会 process success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants