**System.DllNotFoundException:** 'LiteCore' when trying to build for Android

I’m currently trying to build a MAUI app (the successor to Xamarin) and the Windows variant does work as it should. It’s when I’m trying to build for Android (haven’t looked at iOS yet) that I run into the title’s error.

What I’ve done so far:

  • Included the packages Couchbase.Lite 3.0.2 and Couchbase.Lite.Support.Android 3.0.2 under the dependencies for net7.0-Android.
  • Edited Platforms/Android/MainActivity.cs to include the following code:
public class MainActivity : MauiAppCompatActivity
{
    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        Couchbase.Lite.Support.Droid.Activate(this);
    }
}

And then tried to run the application. These are the last lines from Output:

Loaded assembly: Anonymously Hosted DynamicMethods Assembly [External]
[monodroid-assembly] Shared library 'LiteCore' not loaded, p/invoke 'c4log_enableFatalExceptionBacktrace' may fail
[monodroid-assembly] Shared library 'LiteCore' not loaded, p/invoke 'c4log_setBinaryFileLevel' may fail
[monodroid-assembly] Shared library 'LiteCore' not loaded, p/invoke 'c4log_getDomain' may fail
[monodroid-assembly] Shared library 'LiteCore' not loaded, p/invoke 'c4log_setLevel' may fail
[monodroid-assembly] Shared library 'LiteCore' not loaded, p/invoke 'c4log_getDomain' may fail
**System.DllNotFoundException:** 'LiteCore'

So, uh, did I overlook something?

Probably not. The simple fact of the matter is that 3.0.x does not support MAUI targets. .NET 6 is not backward compatible with Xamarin either, so things do not just work going forward. 3.1.0 will be the first release to contain support for .NET 6 / MAUI.

2 Likes

Ah, good to hear that I didn’t miss anything. Thank you for that information. I’ll be patient then and in the meantime simply use the Windows target only to get going.

One last question: Do you have a rough timeline on when 3.1.0 will be released or in preview?

One last question: Do you have a rough timeline on when 3.1.0 will be released or in preview?

It is targeted for the 1H of next year.

1 Like