gindemit / unity-rlottie

Unity library that plays Lottie Animation to Texture2D
MIT License
164 stars 26 forks source link

DllNotFoundException: LottiePlugin assembly on MacOS #11

Closed chile109 closed 1 year ago

chile109 commented 1 year ago

Hello, I followed the manual to open sample scene but get the DLL error.

截圖 2023-06-15 下午5 22 03

This is my environment detail:

I saw there is also a similar issue: https://github.com/gindemit/unity-rlottie/issues/6 How can I fixed that?

simonpham commented 1 year ago

Check this https://github.com/Samsung/rlottie/issues/496

chile109 commented 1 year ago

@simonpham After check your solution, seems like it need Cmake rebuild that rlottie? Sorry I am a Unity Developer and have no experience how to do it, need more clues.

gindemit commented 1 year ago

Hello @chile109, thanks for trying out. It seems that the current compiled native libraries are targeting only x86_64 architecture. And you have the arm64 CPU.

You can check it yourself In terminal:

konstantingindemit@Konstantins-MBP OSX % file libLottiePlugin.dylib
libLottiePlugin.dylib: Mach-O 64-bit dynamically linked shared library x86_64
konstantingindemit@Konstantins-MBP OSX % file librlottie.dylib
librlottie.dylib: Mach-O 64-bit dynamically linked shared library x86_64

Can you please try out the attached files. Archive.zip You need to unpack the zip archive, close Unity project and replace the dylib files in the git/unity-rlottie/unity/RLottieUnity/Assets/LottiePlugin/Plugins/OSX folder.

With the attached files I get following in terminal:

konstantingindemit@Konstantins-MBP rlottieOSXArm64 % file libLottiePlugin.dylib 
libLottiePlugin.dylib: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64
- Mach-O 64-bit dynamically linked shared library x86_64] [arm64:Mach-O 64-bit dynamically linked shared library arm64
- Mach-O 64-bit dynamically linked shared library arm64]
libLottiePlugin.dylib (for architecture x86_64):    Mach-O 64-bit dynamically linked shared library x86_64
libLottiePlugin.dylib (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
konstantingindemit@Konstantins-MBP rlottieOSXArm64 % file librlottie.dylib 
librlottie.dylib: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64
- Mach-O 64-bit dynamically linked shared library x86_64] [arm64:Mach-O 64-bit dynamically linked shared library arm64
- Mach-O 64-bit dynamically linked shared library arm64]
librlottie.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
librlottie.dylib (for architecture arm64):  Mach-O 64-bit dynamically linked shared library arm64
chile109 commented 1 year ago

Hey @gindemit , after replace the libLottiePlugin.dylib the plugin is working now. Thanks for your help and Detailed explanation!