Skip to content
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

new Couchbase.Lite.Database() throws an DllNotFoundException when built for iOS Release target #27944

Closed
tele-bird opened this issue Feb 21, 2025 · 2 comments
Labels
t/bug Something isn't working

Comments

@tele-bird
Copy link

tele-bird commented Feb 21, 2025

Description

We are developing a .NET MAUI app for iOS and Android, and we're seeing an issue where a DllNotFoundException is thrown from within the 3rd party library's "support" library when we attempt to construct a new Couchbase.Lite.Database instance.

Here is the stack trace:

at
Couchbase.Lite.Logging.FileLogger.SetupDomainObjects()
at Couchbase.Lite.Logging.FileLogger..ctor()
at Couchbase.Lite.Logging.Log..ctor()
at Couchbase.Lite.Database..cctor()

This exception is only thrown for Release target builds, so I had the idea to add the MtouchInterpreter.
This fixes the problem:

<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'"> <MtouchInterpreter>Couchbase.Lite.Enterprise.Support.iOS</MtouchInterpreter> </PropertyGroup>

Based on my read of this issue about MtouchInterpreter, I conclude that:

  1. this fix is more of a workaround with the downside of performance issues
  2. the core issue could be fixed by the library author, with the proper support from the community

The library repo is here: https://github.com/couchbase/couchbase-lite-net
I raised a support ticket with Couchbase, and they are working on it, but they tend to beleive that it is a problem with Microsoft’s toolchain. They asked me to initiate a discussion here.

Based on this historical post in the Couchbase community, I tried upgrading workloads, but it didn't fix anything.
I'm using workload version 8.0.406.

Steps to Reproduce

  1. Clone this repo for the .NET MAUI Hello World project that I’ve modified: https://github.com/tele-bird/CouchbaseLiteExample

  2. Remove the workaround (i.e. comment-out the lines in the .csproj file that adds the MtouchInterpreter)

  3. Modify info.plist to use a bundle ID that you can sign via a provisioning profile on your dev box

  4. Select the Release target

  5. Build and deploy the app to your iPhone or Mac

  6. Click the Click me button

Link to public reproduction project repository

https://github.com/tele-bird/CouchbaseLiteExample

Version with bug

Unknown/Other

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

No response

Did you find any workaround?

workaround discussed above

Relevant log output

@tele-bird tele-bird added the t/bug Something isn't working label Feb 21, 2025
@tele-bird
Copy link
Author

The library author opened a ticket here which describes the same issue:
dotnet/macios#22223

@drasticactions
Copy link
Contributor

dotnet/macios#22223 would be the appropriate place for this issue to be addressed, it's unrelated to the MAUI UI project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants