-
Notifications
You must be signed in to change notification settings - Fork 520
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
Release mode on iOS causes DllNotFoundException #22223
Comments
Some additional information that I didn't think to include originally. I use DllImportResolver as follows to redirect "LiteCore" to its equivalent rpath location within the framework: It uses the const string DllName as input https://github.com/couchbase/couchbase-lite-net/blob/3.2.1/src/LiteCore/src/LiteCore.Shared/Constants.cs#L24 The which calls to a P/Invoke function |
This is probably a duplicate of #19624. Can you try some of the suggestions in that issue to see if that works around the problem? |
The exception thrown in that issue is different from what I am seeing, but are you suggesting perhaps that the dead link strip is simply just causing the entire library to be ignored? |
I also noticed that the linked issue is using a static lib. This is a dynamically linked framework if that makes a difference. |
I tried the three workarounds mentioned in the other ticket. The dlsym one didn't work because I realize I have DllImport functions that are not exercised at runtime but are still defined inappropriately outside of a Windows context (the ticket warned that this would fail if that was the case). The other two had no effect. |
For some additional info, I attached a build.log from a release build Some lines of note:
|
Apple platform
iOS
Framework version
net8.0-*
Affected platform version
dotnet CLI 9.0.102
Description
This is a sort of resurrection of #21594
The issue is that when building Debug, things work fine. When building with default Release configuration a DllNotFoundException happens. A nuget package is providing a native ios framework for use via P/Invoke, and this is where the exception happens. The native library is in fact present in both .app bundles (debug and release). Furthermore, turning on
MtouchInterpreter
for the .NET assembly that comes with the native framework also seems to make the problem go away. This only happens on an actual device. The simulator is unaffected.I am the developer of the library in question, and a reproduction repo was provided by a third party that uses our library.
Steps to Reproduce
dotnet build -f net8.0-ios -c:Release -p:RuntimeIdentifier=ios-arm64
Did you find any workaround?
Adding
MtouchInterpreter
on the assembly Couchbase.Lite.Enterprise.Support.iOS as done in tele-bird/CouchbaseLiteExample@443bd5bRelevant logs
No response
The text was updated successfully, but these errors were encountered: