Tencent / puerts

PUER(普洱) Typescript. Let's write your game in UE or Unity with TypeScript.
Other
5.05k stars 703 forks source link

[Unity] Bug: nodeJS版本在mac app上报错DLL Not Found #1889

Closed CheshireLin closed 4 hours ago

CheshireLin commented 4 hours ago

前置阅读 | Pre-reading

Puer的版本 | Puer Version

2.1.0 nodeJS

Unity的版本 | Unity Version

2022.3.27f1

发生在哪个平台 | Platform

mac

错误信息 | Error Message

[194] [16:49:31.883] [E] DoModuleOnEnterGame error XKit.JsMgr System.DllNotFoundException: puerts assembly: type: member:(null) at (wrapper managed-to-native) Puerts.PuertsDLL._GetApiLevel() at Puerts.PuertsDLL.GetApiLevel () [0x00017] in ./packages-source/com.tencent.puerts.core/Runtime/Src/Default/Native/PuertsDLL.cs:90 at Puerts.JsEnv..ctor (Puerts.ILoader loader, System.Int32 debugPort, Puerts.BackendType backend, System.IntPtr externalRuntime, System.IntPtr externalContext) [0x00063] in ./packages-source/com.tencent.puerts.core/Runtime/Src/Default/JsEnv.cs:106 at Puerts.JsEnv..ctor (Puerts.ILoader loader, System.Int32 debugPort) [0x00000] in ./packages-source/com.tencent.puerts.core/Runtime/Src/Default/JsEnv.cs:94

问题重现 | Bug reproduce

mac上editor能正常加载puerts,通过unity打包成mac app就不能正常加载。meta文件也都是下载文件自带的,生成的app中也存在puerts.bundle 文件。v8版本可以打包运行,nodeJS不行。

chexiongsheng commented 4 hours ago

是不是没把libnode.93.dylib打包进去?

CheshireLin commented 4 hours ago

是不是没把libnode.93.dylib打包进去?

确实没看到,但是unity里的设置看起来很正常 Snipaste_2024-11-01_17-05-37 Snipaste_2024-11-01_17-05-08

chexiongsheng commented 4 hours ago

那这种问题应该问unity啊,你都设置要打包它没打包

CheshireLin commented 4 hours ago

那这种问题应该问unity啊,你都设置要打包它没打包

ok,我再尝试下

CheshireLin commented 3 hours ago

最后是删除原来的meta文件,然后重新设置就好了