Start a new topic

SQLite.Net.SQLiteException: no such table: OfflineVersion

Hi all, I am trying to get integrate Kinvey into our xamarin iOS app. I am having a bit of trouble. I followed the getting started guide 


  I have instantiated the client on appdelegate.

kinveyClient = new Client.Builder("XXXXXXX", "XXXXXXX") 
.setLogger((obj) =>Debug.WriteLine(obj))
.setFilePath(NSFileManager.DefaultManager.GetUrls(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomain.User)[0].ToString())
.setOfflinePlatform(new SQLitePlatformIOS())
.build();

  I logged in on the main viewcontroller. 

if (!kinveyService.KinveyClient.User().isUserLoggedIn())
 {
            kinveyService.KinveyUser = await kinveyService.KinveyClient.User().LoginAsync();
 }
 kinveyService.KinveyUser = kinveyService.KinveyClient.User();


  On a button click I i tried to do SaveAsync on a collection. That's when I got the SQLite.Net exception.


AsyncAppData<UserAccount> userAccounts = kinveyService.KinveyClient.AppData<UserAccount>("user-account", typeof(UserAccount));

userAccounts.setOffline(new SQLiteOfflineStore(), OfflinePolicy.ALWAYS_ONLINE);
var userAccount = new UserAccount
 {
          kinvey_id = kinveyService.KinveyUser.Id,
          link_id = "testlink_id"
 };
var saved = await userAccounts.SaveAsync(userAccount);

 

Any help would be much appreciated. Cheers, Alfa.


1 person has this question
1 Comment

Alfa,


What version of Xamarin SDK are you using?
Also can you please attach a screenshot of the error.


Thanks,

Pranav

Kinvey Support


Login or Signup to post a comment