Common Issues
ExecutionEngineException: Could not run the type initializer for origin DHE type 'xxx'
The reason is that the original AOT type replaced by DHE was unexpectedly created. After using DHE, you cannot create the original type corresponding to the type in the DHE assembly. There are several reasons that cause this error:
- Executed code in the DHE assembly before loading the DHE assembly
- The hot update dhe dll and dhao file do not match, causing the original AOT code that should not be executed to be executed incorrectly, creating the original AOT type. Only versions 4.5.7 and earlier that did not strictly validate dlls would have this error
- When throwing exceptions or printing logs, the original function of the DHE assembly was unexpectedly accessed during the process of obtaining function frame stacks. Versions 4.5.8 and earlier have this bug
- The
script debugging
build parameter is enabled
Only changed a small amount of code, but when generating meta version, the output log or .diff.spec
shows a huge amount of struct and method changes
Small code changes generally only affect the function they are in. If a huge amount of function changes occur, it means there is a big difference between the original dhe dll used when generating dhao or the latest dhe dll. There may be several reasons:
- Used the wrong original dhe dll or the latest dhe dll
- Inconsistent development options causing huge dll differences. For example, the development option was enabled when building the main package, but the
CompileDll/activeTarget_development
command was not used when compiling the dll. Or the development option was disabled when building the main package, butCompileDll/activeTarget_development
was used when compiling the dll, both will cause this problem. - The dhe assembly is a pre-compiled dll, and the dhe assembly was stripped when building the main package, causing huge differences with the latest dhe dll. The solution is to add
<assembly fullname="YourExternDll" preserve="all"/>
inlink.xml
to completely preserve the dll
Encountered error Exception: [SignatureToIdMapper] version mismatch, expected 1, but got 0
when generating dhao or mv files
Starting from version v8.4.0, a function signature calculation bug was fixed, and the function signature calculation method changed after the fix. If you use a snapshot generated by an old version of hybridclr with the latest hot update code to generate dhao or mv files, this error will occur.
Solution:
- If you have already released the game App to the public and are using the meta version workflow
Enable the HybridCLRSettings.generateCompatibleMethodSignature
option. However, since this version has a bug in method signature calculation, it is recommended to upgrade to v8.4.0 and higher when republishing the app.
- If you have already released the game App to the public but are using the dhao workflow
You should not encounter this error.
- If still in development
Republish the App and regenerate the aot snapshot.