Skip to content

Commit 2f2cf18

Browse files
committed
- 更新支持的Unity版本信息, 6000.0.x -> 6000.x.6。
- 更新extern相关的错误信息
1 parent 44e96a1 commit 2f2cf18

12 files changed

Lines changed: 39 additions & 14 deletions

File tree

docs/basic/pinvoke.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ hybridclr一直以来都支持调用AOT中定义的extern函数,但自**v8.0.0
2424

2525
## 预留桥接函数
2626

27-
调用PInvoke函数时,同样需要解决managed到native的参数转换,因此需要预先生成该PInvoke函数相应的桥接函数,否则运行时会抛出异常。
27+
调用PInvoke函数时,同样需要解决managed到native的参数转换,因此需要预先生成该PInvoke函数相应的桥接函数,否则运行时会抛出异常 `ExecutionEngineException: NotSupportManaged2NativeFunctionMethod`
2828

2929
对于构造主包时在热更新代码中已经存在的PInvoke函数,会自动为它们生成相应桥接函数,不需要特殊处理。对于未来可能用到,但没有现存跟它
3030
相同签名的PInvoke函数的函数,需要为它预留相应桥接函数。

docs/basic/supportedplatformanduniyversion.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# 支持的Unity版本和平台
33

4-
HybridCLR已经稳定支持了2019.4.x、2020.3.x、2021.3.x、2022.3.x 系列LTS版本及2023.2.x、6000.0.x等测试版本,并且支持所有il2cpp支持的平台。
4+
HybridCLR已经稳定支持了2019.4.x、2020.3.x、2021.3.x、2022.3.x 系列LTS版本及2023.2.x、6000.x.y等测试版本,并且支持所有il2cpp支持的平台。
55

66
## 兼容的Unity版本
77

@@ -18,7 +18,7 @@ HybridCLR也支持Unity 2017-2018,但未包含在社区版本。如果确实
1818
- 2021.3.x
1919
- 2022.3.x
2020
- 2023.2.x
21-
- 6000.0.x
21+
- 6000.x.y
2222

2323
:::tip
2424

docs/help/commonerrors.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,15 @@ WebGL使用全局安装,你没有将本地`{project}/HybridCLRData/LocalIl2Cpp
244244
团结引擎1.1.x为微信小游戏平台新增的metadta index slim优化会导致hybridclr无法在微信小游戏平台正常运行。
245245
自团结引擎1.2.0版本起 WinxinMiniGame平台的Publishing Settings中新增了`Use Slim Format For global-metadata.dat`选项,禁用这个优化后可以正常使用hybridclr。
246246

247+
### `HybridCLR/Generate/All`或构建时出现"PInvoke method {method.FullName} has unsupported parameter or return type. Please check the method signature."
248+
249+
在热更新代码中定义的extern函数不支持string或者数组之类的参数或者返回值,请将相应参数修改为IntPtr同时自行marshal这些参数,或者将该函数移到AOT中定义。详细请见[PInvoke支持](../basic/pinvoke)
250+
251+
### `HybridCLR/Generate/All`或构建时出现"MonoPInvokeCallback method {method.FullName} has unsupported parameter or return type. Please check the method signature."
252+
253+
在热更新代码中定义的添加了`[MonoPInvokeCallback]`特性的函数不支持string或者数组之类的参数或者返回值,请将相应参数修改为IntPtr同时自行marshal这些参数,或者将该函数移到AOT中定义。
254+
详细请见[MonoPInvokCallback支持](../basic/monopinvokecallback)
255+
247256
## 运行时错误
248257

249258
### EntryPointNotFoundException. Unable to find entry point named 'RuntimeApi_LoadMetadataForAOTAssembly' in 'GameAssembly`
@@ -386,6 +395,10 @@ HybridCLR提供了快捷的自动生成工具,运行菜单命令 `HybridCLR/Ge
386395

387396
如果还有问题,请在群里反馈给管理员 技术支持。
388397

398+
### 遇到`ExecutionEngineException: NotSupportManaged2NativeFunctionMethod`
399+
400+
这是热更新代码中定义的extern函数缺失桥接函数引起。请在构建主包时提前预留extern函数相关的桥接函数。详细见文档[PInvoke支持](../basic/pinvoke)
401+
389402
### ExecutionEngineException: Attempting to call method 'xxxx' for which no ahead of time (AOT) code was generated.
390403

391404
为出错的函数所在的dll补充元数据即可。

i18n/en/docusaurus-plugin-content-docs/current/basic/pinvoke.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Supporting extern functions relies on the runtime to find function symbols in dy
2424

2525
## Reserved bridge function
2626

27-
When calling a PInvoke function, you also need to solve the parameter conversion from managed to native, so you need to generate the corresponding bridge function for the PInvoke function in advance, otherwise an exception will be thrown at runtime.
27+
When calling a PInvoke function, you also need to solve the parameter conversion from managed to native, so you need to generate the corresponding bridge function for the PInvoke function in advance, otherwise an exception `ExecutionEngineException: NotSupportManaged2NativeFunctionMethod` will be thrown at runtime.
2828

2929
For PInvoke functions that already exist in the hot update code when constructing the main package, the corresponding bridge function will be automatically generated for them, and no special processing is required. For functions that may be used in the future but do not have an existing PInvoke function with the same signature, you need to reserve the corresponding bridge function for it.
3030

i18n/en/docusaurus-plugin-content-docs/current/basic/supportedplatformanduniyversion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Due to maintenance cost considerations, HybridCLR only supports the LTS series v
1111
- 2021.3.x
1212
- 2022.3.x
1313
- 2023.2.x
14-
- 6000.0.x
14+
- 6000.x.y
1515

1616
:::tip
1717

i18n/en/docusaurus-plugin-content-docs/current/help/commonerrors.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ To a large extent, it is caused by the mismatch between your package and hybridc
218218

219219
If your version is 2020.3.0-2020.3.25, after completing the installation in the Installer, copy `2020.3.x/Editor/Data/il2cpp/external` from the installation directory of any version 2020.3.26+ and replace `{project} /HybridCLRData/LocalIl2CppData-{platform}/il2cpp/external`
220220

221+
### "PInvoke method {method.FullName} has unsupported parameter or return type. Please check the method signature." appears when calling `HybridCLR/Generate/All` or building
222+
223+
The extern function defined in the hot update code does not support parameters or return values ​​such as string or array. Please change the corresponding parameters to IntPtr and marshal these parameters yourself, or move the function to AOT for definition. For details, please see [PInvoke support](../basic/pinvoke).
224+
225+
### "MonoPInvokeCallback method {method.FullName} has unsupported parameter or return type. Please check the method signature." appears when calling `HybridCLR/Generate/All` or building
226+
227+
The function defined in the hot update code with the `[MonoPInvokeCallback]` attribute added does not support parameters or return values ​​such as string or array. Please change the corresponding parameters to IntPtr and marshal these parameters yourself, or move the function to AOT for definition.
228+
See [MonoPInvokCallback support](../basic/monopinvokecallback) for details.
221229

222230
## Runtime errors
223231

@@ -361,6 +369,10 @@ If it works fine on Android but has problems on iOS, it is because you did not r
361369

362370
If you still have problems, please give feedback to the administrator technical support in the group.
363371

372+
### Encountered `ExecutionEngineException: NotSupportManaged2NativeFunctionMethod`
373+
374+
This is caused by the lack of bridge functions for the extern functions defined in the hot update code. Please reserve bridge functions related to extern functions in advance when building the main package. For details, see the document [PInvoke support](../basic/pinvoke).
375+
364376
### ExecutionEngineException: Attempting to call method 'xxxx' for which no ahead of time (AOT) code was generated.
365377

366378
Just add metadata to the dll where the error function is located.

i18n/en/docusaurus-plugin-content-docs/version-7.10.0/basic/supportedplatformanduniyversion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Due to maintenance cost considerations, HybridCLR only supports the LTS series v
1111
- 2021.3.x
1212
- 2022.3.x
1313
- 2023.2.x
14-
- 6000.0.x
14+
- 6000.x.y
1515

1616
:::tip
1717

i18n/en/docusaurus-plugin-content-docs/version-7.6.0/basic/supportedplatformanduniyversion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Due to maintenance cost considerations, HybridCLR only supports the LTS series v
1111
- 2021.3.x
1212
- 2022.3.x
1313
- 2023.2.x
14-
- 6000.0.x
14+
- 6000.x.y
1515

1616
:::tip
1717

i18n/en/docusaurus-plugin-content-docs/version-7.8.1/basic/supportedplatformanduniyversion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Due to maintenance cost considerations, HybridCLR only supports the LTS series v
1111
- 2021.3.x
1212
- 2022.3.x
1313
- 2023.2.x
14-
- 6000.0.x
14+
- 6000.x.y
1515

1616
:::tip
1717

versioned_docs/version-7.10.0/basic/supportedplatformanduniyversion.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# 支持的Unity版本和平台
33

4-
HybridCLR已经稳定支持了2019.4.x、2020.3.x、2021.3.x、2022.3.x 系列LTS版本及2023.2.x、6000.0.x等测试版本,并且支持所有il2cpp支持的平台。
4+
HybridCLR已经稳定支持了2019.4.x、2020.3.x、2021.3.x、2022.3.x 系列LTS版本及2023.2.x、6000.x.y等测试版本,并且支持所有il2cpp支持的平台。
55

66
## 兼容的Unity版本
77

@@ -18,7 +18,7 @@ HybridCLR也支持Unity 2017-2018,但未包含在社区版本。如果确实
1818
- 2021.3.x
1919
- 2022.3.x
2020
- 2023.2.x
21-
- 6000.0.x
21+
- 6000.x.y
2222

2323
:::tip
2424

0 commit comments

Comments
 (0)