0

I am getting the following error when i attempt to reference the sqlite-net-pcl package in the Android project of Xamarin forms project. I get this error when building in release mode but debug mode seems to be fine. I am using

sqlite-net-pcl 1.4.118

Xamarin.Forms 2.4.0.282

Xamarin.Android.Support.* 25.4.0.2

Error Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'SQLite-net, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'SQLite-net.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection1 assemblies, AssemblyDefinition assembly, Boolean topLevel)    at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver) CouchPortfolioApp.Android
ankuranurag2
  • 2,300
  • 15
  • 30
TrustyCoder
  • 4,749
  • 10
  • 66
  • 119

2 Answers2

2

You should reference sqlite-net-pcl in your target platform project as well.

rawel
  • 2,923
  • 21
  • 33
0

I had a similar problem with sqlite-net-pcl and .NET Standard 2.0 when I was building in debug mode. I changed the linker and cleaned and rebuilt the solution (I even deleted the bin and obj folder).

In the properties of the project -> android options -> linking -> "SDK assembly Only"

In my case in release worked with "None"

Android Options:

enter image description here

pushkin
  • 9,575
  • 15
  • 51
  • 95