2

I'm build a xamarin forms app using Azure Mobile Services for offline sync - versions are:

  • Microsoft.Azure.Mobile.Client 3.1.0
  • Microsoft.Azure.Mobile.Client.SQLiteStiore 3.1.0
  • SQLitePCL 3.8.7.2
  • SQLitePCLRaw.bundle_green 1.1.2
  • SQLitePCLRaw.core 1.1.2

This was working fine, until I added akavache (5.0.0) to my project, before adding any akavache specific code, I ran the project and found

MobileServiceSQLiteStore store = new MobileServiceSQLiteStore(path);

was throwing an TyleLoadException:

Could not load type 'SQLitePCL.SQLite3Provider_internal' from assembly 'SQLitePCLRaw.provider.internal, Version=1.0.0.0, Culture=neutral, PublicKeyToken=89ae75803b2c608d'.

Has anyone come across this before? When I remove akavache, everything returns to normal.

markpirvine
  • 1,369
  • 1
  • 19
  • 43

2 Answers2

2

Yeah I faced this problem for the longest time also. Unfortunately the package dependencies between Azure MobileServices and Akavache on Sqlite conflict. When I install the NuGet packages for Mobile Services, it installs different versions of the libraries you have listed above:

Installed in my project

  • SQLitePCLRaw.bundle_green" version="1.0.0"
  • SQLitePCLRaw.core version="1.0.0

The problem is that Akavache installs additional packages and upgrades some of your SQLite packages. Other people have reported problems using Azure Mobile App with Akavache.

I would recommend trying out something else as your persistent Key-Store like the SecureStorage Xamarin Plugin Component or maybe Xamarin.Auth works if you just need to store a user account with data.

BrewMate
  • 1,000
  • 4
  • 14
1

You need to update your SQLiteRaw to v1.1.2 - this was a fix that was put in place by Eric Sink. The latest .NET Client SDK for Azure Mobile Apps uses the right version. Unfortunately, Akavache also needs to use this version, so we have a partial answer right now.

Adrian Hall
  • 7,718
  • 1
  • 15
  • 26