-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need a way to load Static library for iOS in Unity via your Nuget based C# DLL #1859
Comments
Everything is open-sourced.
Yes, the code is at https://github.com/k2-fsa/sherpa-onnx
https://github.com/k2-fsa/sherpa-onnx/blob/master/build-ios.sh FYI: We have been using ios shared libs in flutter for iOS. The code for building sherpa-onnx shared libs for ios is at |
Hi thank you for responding so fast. The issue is not that I'm not able to build libraries. I was able to build. But issue was current C# DLL imports library considering via name istead of __internal keyword as per unity's this documentation. But I'll check into your links and will try to modify the DLL to see if I'm able to fix it. I'll report it back here for future readers comming from Unity community. |
Can you rename the dll to _internal? |
I dont think renaming would work. Because what I showed you in the image above (I'm rewriting the same code below) is how Unity want's it to be.
But in your current DLL, this is the code
So notice how your C# DLL currently importing the library via its name which only works for Android platform in unity. To make it work on ios to link static library, I'll have to modify name to the keyword __internal and then it will load ios library too in unity. |
did you manage it? |
Hi David, I just could not find time to work on it. But today I'm gonna work on it and will let you know how it went. |
Hi @DavidPolastik @csukuangfj so finally it loaded in unity iOS too. All I had to do is decomplie main dll and the replaced |
Hi, I'm from the unity Ecosystem and I went through very good discussions between you and a unity developer and following those threads, I was able to build and run your solution for Offline TTS in android and it works nicely. But the issue now I'm having is I want to do the same in iOS too but your code in C# DLL (I got it from nuget package of yours) only imports DLL by naming the library which in unity is only valid for dynamic libraries. And for iOS, we need to link static libraries and for that unity required DLL import attribute to be like [DllImport("__internal")] instead of [DllImport("sherpa-onnx-c-api")]
Is there any way we can have 2 versions of that DLL or if the code for the DLL is open source, can I have the source code files so that I can have 2 DLLs one for android shared library and one for ios static.
Thanks.
The text was updated successfully, but these errors were encountered: