chexiongsheng/puerts_unity_demo

Mac下打包 09_nodejs demo 的时候报错DllNotFoundException

artiely opened this issue · 9 comments

日志如下

Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/puerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/puerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/puerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/puerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/puerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/puerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/puerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/puerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
DllNotFoundException: puerts
  at (wrapper managed-to-native) Puerts.PuertsDLL.GetLibVersion()
  at Puerts.PuertsDLL.GetApiLevel () [0x0000c] in /Users/tanjie/Desktop/puerts_unity_demo-master/package/Runtime/Src/Native/PuertsDLL.cs:92 
  at Puerts.JsEnv..ctor (Puerts.ILoader loader, System.Int32 debugPort, System.IntPtr externalRuntime, System.IntPtr externalContext) [0x00063] in /Users/tanjie/Desktop/puerts_unity_demo-master/package/Runtime/Src/JsEnv.cs:75 
  at Puerts.JsEnv..ctor (Puerts.ILoader loader, System.Int32 debugPort) [0x00000] in /Users/tanjie/Desktop/puerts_unity_demo-master/package/Runtime/Src/JsEnv.cs:63 
  at PuertsTest.NodeJS.Start () [0x00001] in /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/Assets/Examples/09_Node.js/NodeJS.cs:21 

(Filename: /Users/tanjie/Desktop/puerts_unity_demo-master/package/Runtime/Src/Native/PuertsDLL.cs Line: 92)

Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/puerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.dylib
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.so
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts.bundle
Fallback handler could not load library /Users/tanjie/Desktop/puerts_unity_demo-master/projects/0_Basic_Demo/1.app/Contents/Frameworks/MonoEmbedRuntime/osx/libpuerts
Metal RecreateSurface[0x111b52740]: surface size 545x540

我是按照文档操作如下
git clone https://github.com/chexiongsheng/puerts_unity_demo.git
open projects/0_Basic_Demo
然后打包
我不确定是不是还有什么其他步骤我没有做

是没有那库么?
如果有,应该是平台没设置好

现在仓库上是带有M1版本的binary的,如果你使用的版本低于2021,Unity可能不识别这个binary的配置,并且将它优先打包了进去。造成DLLNotFound

如果确认你的Unity低于2021,可以直接删掉arm64目录的dylib

现在仓库上是带有M1版本的binary的 @zombieyang

多谢回复,我使用的 unity2020,2021 我也试过一样的问题, mac 是 intel. 我删除了 arm64 下的所有.dylib 问题依旧.请问不是 M1 的该如何处理

是没有那库么? 如果有,应该是平台没设置好

@chexiongsheng 我是直接克隆的官方 demo,并安装了 puterts, 不清楚您说的库是什么,平台该如何设置

是没有那库么? 如果有,应该是平台没设置好

@chexiongsheng 我是直接克隆的官方 demo,并安装了 puterts, 不清楚您说的库是什么,平台该如何设置,play 模式都是正常的

现在仓库上是带有M1版本的binary的 @zombieyang

多谢回复,我使用的 unity2020,2021 我也试过一样的问题, mac 是 intel. 我删除了 arm64 下的所有.dylib 问题依旧.请问不是 M1 的该如何处理

那再确认下 x86_64下的dylibbundle的平台设置是否正确?

现在仓库上是带有M1版本的binary的 @zombieyang

多谢回复,我使用的 unity2020,2021 我也试过一样的问题, mac 是 intel. 我删除了 arm64 下的所有.dylib 问题依旧.请问不是 M1 的该如何处理

那再确认下 x86_64下的dylibbundle的平台设置是否正确?

@zombieyang 平台设置? 需要怎么设置,除了 sudo xattr -r -d com.apple.quarantine puerts.bundle 之外还要做什么?

image

就这些

我自己尝试复现过你的问题。

在原始情况下build了跑不了,但删掉arm64目录就好了。