1

I’m trying to make work Akavache in a Windows Universal Application (8.1 for now, using ReactiveUI 6.5).

To make sure that it is not related to my architecture, I did an empty solution that has all the necessary packages and requirements (VC++ for both platforms), and I still get the same issue. This is a blocker for me since I want all my queries to be cached.

Here's the code:

BlobCache.ApplicationName = "MyApp"; // In AppBootstrapper`

// In My ViewModel
SubmitCommand = ReactiveCommand.CreateAsyncTask(async _ =>
{
    var isTrue = await BlobCache.UserAccount.GetOrFetchObject("login_credentials",
        async () => await Task.FromResult(true)
    );
    // My Code never goes further than this

    if (!isTrue)
    {
        throw new Exception("I'm false!");
    }

    return isTrue;
});

SubmitCommand.Subscribe(isTrue => {
    Debug.WriteLine("I got a new value!");
});

SubmitCommand.ThrownExceptions.Subscribe(ex => {
    UserError.Throw(ex.Message, ex);
});

// In The View
ViewModel = new MainPageViewModel();
this.BindCommand(ViewModel, x => x.SubmitCommand, x => x.SubmitCommand);

public MainPageViewModel ViewModel
{
    get { return (MainPageViewModel)GetValue(ViewModelProperty); }
    set { SetValue(ViewModelProperty, value); }
}
public static readonly DependencyProperty ViewModelProperty =
    DependencyProperty.Register("ViewModel", typeof(MainPageViewModel), typeof(MainPage), new PropertyMetadata(null));

object IViewFor.ViewModel
{
    get { return ViewModel; }
    set { ViewModel = (MainPageViewModel)value; }
}

Edit After some debug, Windows Phone 8.1 Silverlight works, not Jupiter.

So what's missing?

I'm using RXUI 6.5 (latest) with a Windows Phone 8.1 (Jupiter) (with shared Universal Projects)

Updated: Akavache.Sqlite3 is causing the issue. InMemoryCache is working (removing Akavache.Sqlite3 "fixes" the problem), but not Sqlite3. Also, registering BlobCache's different types of cache (copy paste from https://github.com/akavache/Akavache/blob/3c1431250ae94d25cf7ac9637528f4445b131317/Akavache.Sqlite3/Registrations.cs#L32) is working apparently.. so I suppose the Registration class aren't working properly and calling new Akavache.Sqlite3.Registrations().Register(Locator.CurrentMutable); is not working.

Edit: My temporary solution is to copy paste this into my application, and I invoke it after BlobCache.ApplicationName. It works, but I shouldn't technically have to do that.

Thanks for your help

Martin Gemme
  • 345
  • 3
  • 17
  • I even installed VS2012, tried to make a project (WP8.0) with earlier version of Akavache and either I get a problem that SqlitePCL_raw needs to be 0.6.3 when the requirements for Akavache requires >= 0.7.0 or other problems. I would beg for a sample that works on Windows 8.1 Universal. – Martin Gemme Jun 25 '15 at 22:03
  • Please edit your question to show the code. Don't link to off-site resources that may change in the future. – Enigmativity Jun 26 '15 at 01:47
  • @Enigmativity Since there might be a configuration issue, I wanted to provide the full sample I did. – Martin Gemme Jun 26 '15 at 01:59
  • Sure, but please edit your question to show the code nonetheless. If you feel that you must keep the link that's fine, but you should still show the code in the question. I suspect that the lack of any answers so far is due to the code only being in the zip. – Enigmativity Jun 26 '15 at 02:06
  • @Enigmativity Included. – Martin Gemme Jun 26 '15 at 02:24

0 Answers0