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

Unity 2021.3.26 无法热更 async/await #400

Open
lishengru opened this issue Jul 20, 2023 · 5 comments · May be fixed by #401
Open

Unity 2021.3.26 无法热更 async/await #400

lishengru opened this issue Jul 20, 2023 · 5 comments · May be fixed by #401

Comments

@lishengru
Copy link

ExecutionEngineException: Attempting to call method 'Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskMethodBuilder::AwaitUnsafeOnCompleted<Cysharp.Threading.Tasks.UniTask+Awaiter,IFix.ILFixInterfaceBridge>' for which no ahead of time (AOT) code was generated.
at IFix.Core.ReflectionMethodInvoker.Invoke (IFix.Core.VirtualMachine virtualMachine, IFix.Core.Call& call, System.Boolean isInstantiate) [0x00000] in <00000000000000000000000000000000>:0
at IFix.Core.VirtualMachine.Execute (IFix.Core.Instruction* pc, IFix.Core.Value* argumentBase, System.Object[] managedStack, IFix.Core.Value* evaluationStackBase, System.Int32 argsCount, System.Int32 methodIndex, System.Int32 refCount, IFix.Core.Value** topWriteBack) [0x00000] in <00000000000000000000000000000000>:0
at IFix.Core.VirtualMachine.Execute (System.Int32 methodIndex, IFix.Core.Call& call, System.Int32 argsCount, System.Int32 refCount) [0x00000] in <00000000000000000000000000000000>:0
at IFix.ILFixInterfaceBridge.MoveNext () [0x00000] in <00000000000000000000000000000000>:0
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <00000000000000000000000000000000>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0
at IFix.Core.ReflectionMethodInvoker.Invoke (IFix.Core.VirtualMachine virtualMachine, IFix.Core.Call& call, System.Boolean isInstantiate) [0x00000] in <00000000000000000000000000000000>:0
at IFix.Core.VirtualMachine.Execute (IFix.Core.Instruction* pc, IFix.Core.Value* argumentBase, System.Object[] managedStack, IFix.Core.Value* evaluationStackBase, System.Int32 argsCount, System.Int32 methodIndex, System.Int32 refCount, IFix.Core.Value** topWriteBack) [0x00000] in <00000000000000000000000000000000>:0
at IFix.Core.VirtualMachine.Execute (IFix.Core.Instruction* pc, IFix.Core.Value* argumentBase, System.Object[] managedStack, IFix.Core.Value* evaluationStackBase, System.Int32 argsCount, System.Int32 methodIndex, System.Int32 refCount, IFix.Core.Value** topWriteBack) [0x00000] in <00000000000000000000000000000000>:0
at IFix.Core.VirtualMachine.Execute (System.Int32 methodIndex, IFix.Core.Call& call, System.Int32 argsCount, System.Int32 refCount) [0x00000] in <00000000000000000000000000000000>:0
at IFix.ILFixInterfaceBridge.MoveNext () [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00000] in <00000000000000000000000000000000>:0
at Cysharp.Threading.Tasks.UniTaskCompletionSourceCore`1[TResult].TrySetResult (TResult result) [0x00000] in <00000000000000000000000000000000>:0
at Cysharp.Threading.Tasks.UniTask+DelayFramePromise.MoveNext () [0x00000] in <00000000000000000000000000000000>:0
at Cysharp.Threading.Tasks.Internal.PlayerLoopRunner.RunCore () [0x00000] in <00000000000000000000000000000000>:0
--- End of stack trace from previous location where exception was thrown ---

UlyssesWu added a commit to UlyssesWu/InjectFix that referenced this issue Jul 20, 2023
@AskrYggdrasillsCR
Copy link

怎么样,你解决了吗

@lishengru
Copy link
Author

解决了,但是没有完全解决
首先按照这个提交改下源码,重新生成ifix.dll,然后生成patch文件时用fix,不要用fix(android)或fix(ios)
可以热更async,但是async中如果插入原本没有得函数还是会报错

@AskrYggdrasillsCR
Copy link

解决了,但是没有完全解决 首先按照这个提交改下源码,重新生成ifix.dll,然后生成patch文件时用fix,不要用fix(android)或fix(ios) 可以热更async,但是async中如果插入原本没有得函数还是会报错

可以加个qq讨论下吗?906851424,按这个提交我修改了下源码,编译后像这种await Task.Delay(1000);依然无法调用到,之后的代码也无法执行

@lishengru
Copy link
Author

解决了,但是没有完全解决 首先按照这个提交改下源码,重新生成ifix.dll,然后生成patch文件时用fix,不要用fix(android)或fix(ios) 可以热更async,但是async中如果插入原本没有得函数还是会报错

可以加个qq讨论下吗?906851424,按这个提交我修改了下源码,编译后像这种await Task.Delay(1000);依然无法调用到,之后的代码也无法执行

改成unitask就可以了

@UlyssesWu
Copy link

但是async中如果插入原本没有得函数还是会报错

报的什么错?

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

Successfully merging a pull request may close this issue.

3 participants