Login persistance with Akavache

tkowalczyktkowalczyk PLMember, University ✭✭

Hi All,

I'm trying to implement login persistance feature in my app with Akavache but so far without success.
I want to have it because I don't want user to login in every single time he starts an application.

So in my SignInViewModel I am doing smth like this:

`User u = await _userRepository.SignIn(uDTO);

            if(u != null)
            {
                await BlobCache.UserAccount.InsertObject("User", u);

                MessagingCenter.Send<User>(u, "Authorized");
            }`

This is working OK the object is saved but in my Application based class I am doing smth like this:

`protected override void OnStart ()
    {
        base.OnStart ();

        BlobCache.UserAccount.GetObject<User>("User")
                .Subscribe(x => _u = x, ex => Console.WriteLine("No Key!"));

        if (_u != null) 
        {
            MessagingCenter.Send<User>(_u, "Authorized");
        }
    }`

I don't know how to test it on emulator, so I decided to test it on Android device, but after sign in, close and start the application I am not signed in.
What am I doing wrong? How to debug this (when I close the app the debugger close too)
thx

«1

Posts

  • GeoffArmstrongGeoffArmstrong CAMember ✭✭

    I don't have anything useful to contribute except to point out that Paul Betts hangs out in https://reactivex.slack.com/messages/akavache/ and you might want to chat about it there...

  • tkowalczyktkowalczyk PLMember, University ✭✭

    @GeoffArmstrong Nice thanks, who should invite me or how to join? I haven't use slack before.

  • JohnWilson.4976JohnWilson.4976 AUMember ✭✭

    @tkowalczyk I actually have (almost) exactly the same problem. The cache entries (or maybe even the cache itself) doesn't appear to survive between app restarts. I can't find the file it says it's referencing (usually /data/data/packageName/xyzblob.db) either. I also thought maybe it might have something to do with the WRITE_EXTERNAL_STORAGE permissions, but that didn't help either.

    There may be something around the "BlobCache.Shutdown" method, but I have no idea where to call that, other than forcibly. I have multiple activities in my app, so doing reference counting shutdowns and initialisations is a deal breaker.

    I've used slack, it's awesome (basically browser-based irc), but it looks like you (and I) will need to be invited to that slack group by an admin before we can join. either that or i'm missing something.

  • tkowalczyktkowalczyk PLMember, University ✭✭

    @wislon uff nice to know that I am not the only one with this issue. I saw many blogs entries about Akavache and how cool is that, for example here:
    http://arteksoftware.com/resilient-network-services-with-xamarin/
    http://www.trsneed.com/just-use-akavache-again/

    so I decided to give it a try and I fall into many problems.

    Could you share some code related to this issue?

    I have tweeted to @PaulBetts so maybe he will be so kind and invite me there ;)

  • JohnWilson.4976JohnWilson.4976 AUMember ✭✭

    @tkowalczyk seems we've been looking at the same blog posts.

    • I'm using it in a shared library (with the Sqlite3 package).
    • I know the caching stuff is working (at least in memory) because I get exceptions if I try and hit a cache key that's missing.

    It's just really frustrating, because it's the only thing stopping me from moving on with my app. I've got a choice now. Either I can clone and try and reference the version on github, add the relevant projects to my app, and set a few breakpoints in the akavache code. Or chuck it all out in favour of some sort of shared preferences helper.

  • tkowalczyktkowalczyk PLMember, University ✭✭

    @wislon maybe the problem is somewhere here:
    I am using BlobCache.UserAccount instead of BlobCache.LocalMachine according the descriptions from here, maybe here is the problem? and on mobile devices to store data between application states we should use BlobCache.LocalMachine ?

  • JohnWilson.4976JohnWilson.4976 AUMember ✭✭

    @tkowalczyk I've tried using Secure and UserAccount, but not machine. And I have a sneaky suspicion you may be on to something. I read somewhere a while ago that when an app gets launched, it gets a user assigned to it, based on the package name. It's a very vague recollection.

    I do know that whenever you debug a new version of your app, unless you're using the fast deployment option, everything gets blown away and recreated. However, if you're manually starting the app and shutting it down and restarting it, it should make no difference.

    I am going to try with the LocalMachine option quickly and see... will let you know either way!

  • tkowalczyktkowalczyk PLMember, University ✭✭

    @wislon OK, please check it and let me know, I will be to able to check this later too and leave here some feedback.

  • JohnWilson.4976JohnWilson.4976 AUMember ✭✭

    Nope. Not LocalMachine either. Still the same problem. I'm going to try a couple of other things later, will post results here (whether they work or not)

  • JohnWilson.4976JohnWilson.4976 AUMember ✭✭

    Nothing works. I've put a question into Stack Overflow about it: http://stackoverflow.com/questions/28294496/akavache-not-persisting-cache-data-between-app-restarts

  • JohnWilson.4976JohnWilson.4976 AUMember ✭✭

    @tkowalczyk this may help you with your emulator problem, but it doesn't solve the akavache issue: http://stackoverflow.com/questions/19832940/xamarin-auth-account-data-not-persisted-when-app-is-updated?rq=1

  • TimSneedTimSneed USUniversity ✭✭
    edited February 2015

    I will give this a closer look at lunch, but I want to add that on the apps I have used Akavache, I use IBlobCache in my Core library, and inject the platform specific implementation/do the initialize in the platform project at startup.

  • tkowalczyktkowalczyk PLMember, University ✭✭

    @TimSneed Thank you for your answer could you give us a simple sample how to properly use Akavache in Xamarin.Forms without "application restart defects"?

  • PaulBettsPaulBetts USMember, Insider, Beta ✭✭

    Hey guys, this bug usually indicates that Akavache.SQLite3 isn't included somehow. I'll verify that it isn't a bug on my end, but you can also check this by seeing the value of

    BlobCache.LocalMachine.GetType()
    
  • tkowalczyktkowalczyk PLMember, University ✭✭
    edited February 2015

    @PaulBetts here is my OnStart() implementation:

    `protected override void OnStart ()
        {
            base.OnStart ();
    
            BlobCache.LocalMachine.GetObject<User>("User")
                    .Subscribe(x => _u = x, ex => 
                    {
                        Insights.Report(ex, new Dictionary <string, string> { 
                            {"Login Persistence", "No user found!"},
                            {"Message", ex.Message}
                        });
                    });
    
            BlobCache.LocalMachine.GetType ();
    
            if (_u != null) 
            {
                SaveToken (_u.authentication_token);
    
                MessagingCenter.Send<User>(_u, "Authorized");
            }
        }`
    

    And this what BlobCache.LocalMachine.GetType() is returning:

    {Akavache.Sqlite3.SQLitePersistentBlobCache} Assembly: {Akavache.Sqlite3, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null} AssemblyQualifiedName: "Akavache.Sqlite3.SQLitePersistentBlobCache, Akavache.Sqlite3, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null" Static members: Non-public members: Attributes: System.Reflection.TypeAttributes.BeforeFieldInit|System.Reflection.TypeAttributes.Public BaseType: {System.Object} ContainsGenericParameters (System.Type): false ContainsGenericParameters (System.MonoType): false CustomAttributes: Count=0 DeclaredConstructors: {System.Reflection.ConstructorInfo[2]} DeclaredEvents: {System.Reflection.EventInfo[0]} DeclaredFields: {System.Reflection.FieldInfo[9]} DeclaredMembers: {System.Reflection.MemberInfo[63]} DeclaredMethods: {System.Reflection.MethodInfo[41]} DeclaredNestedTypes: {System.Reflection.TypeInfo} DeclaredProperties: {System.Reflection.PropertyInfo[3]} DeclaringMethod (System.MonoType): System.InvalidOperationException: DeclaringMethod can only be used on generic arguments DeclaringMethod (System.Type): (null) DeclaringType (System.Type): (null) DeclaringType (System.MonoType): (null) FullName: "Akavache.Sqlite3.SQLitePersistentBlobCache" GUID: {00000000-0000-0000-0000-000000000000} GenericParameterAttributes: System.InvalidOperationException: Operation is not valid due to the current state of the object GenericParameterPosition: System.InvalidOperationException: Operation is not valid due to the current state of the object GenericTypeArguments: {System.Type[0]} GenericTypeParameters: {System.Type[0]} HasElementType: false ImplementedInterfaces: {System.MonoType[4]} IsAbstract: false IsAnsiClass: true IsArray: false IsAutoClass: false IsAutoLayout: true IsByRef: false IsCOMObject: false IsClass: true IsConstructedGenericType (System.MonoType): false IsConstructedGenericType (System.Type): System.NotImplementedException: The requested feature is not implemented. IsContextful: false IsEnum: false IsExplicitLayout: false IsGenericParameter (System.Type): false IsGenericParameter (System.MonoType): false IsGenericType: false IsGenericTypeDefinition: false IsImport: false IsInterface: false IsLayoutSequential: false IsMarshalByRef: false IsNested: false IsNestedAssembly: false IsNestedFamANDAssem: false IsNestedFamORAssem: false IsNestedFamily: false IsNestedPrivate: false IsNestedPublic: false IsNotPublic: false IsPointer: false IsPrimitive: false IsPublic: true IsSealed: false IsSecurityCritical (System.Type): System.NotImplementedException: The requested feature is not implemented. IsSecurityCritical (System.MonoType): false IsSecuritySafeCritical (System.MonoType): false IsSecuritySafeCritical (System.Type): System.NotImplementedException: The requested feature is not implemented. IsSecurityTransparent (System.MonoType): true IsSecurityTransparent (System.Type): System.NotImplementedException: The requested feature is not implemented. IsSerializable: false IsSpecialName: false IsUnicodeClass: false IsValueType: false IsVisible: true MemberType (System.Type): 32 MemberType (System.MonoType): System.Reflection.MemberTypes.TypeInfo MetadataToken: 33554502 Module (System.Reflection.MemberInfo): System.NullReferenceException: Object reference not set to an instance of an object Module (System.MonoType): {Akavache.Sqlite3.dll} Name: "SQLitePersistentBlobCache" Namespace: "Akavache.Sqlite3" ReflectedType (System.MonoType): (null) ReflectedType (System.Type): (null) StructLayoutAttribute (System.MonoType): {System.Runtime.InteropServices.StructLayoutAttribute} StructLayoutAttribute (System.Type): System.NotSupportedException: Operation is not supported. TypeHandle (System.MonoType): {System.RuntimeTypeHandle} TypeHandle (System.Type): System.ArgumentException: Derived class must provide implementation. TypeInitializer: {Void .cctor()} UnderlyingSystemType: {Akavache.Sqlite3.SQLitePersistentBlobCache}
    Any advices how to go further and get this working?
    Best

  • tkowalczyktkowalczyk PLMember, University ✭✭
    edited February 2015

    BTW I am also getting this warning:

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Warning: Mono.CompilerServices.SymbolWriter.MonoSymbolFileException: Symbol file /Users/tomaszkowalczyk/Desktop/GitHub/persevymobile/Persevy/packages/akavache.sqlite3.4.1.0/lib/Portable-Net45+Win8+WP8+Wpa81/Akavache.Sqlite3.dll.mdb' does not match assembly /Users/tomaszkowalczyk/Desktop/GitHub/persevymobile/Persevy/packages/akavache.sqlite3.4.1.0/lib/Portable-Net45+Win8+WP8+Wpa81/Akavache.Sqlite3.dll' at Mono.CompilerServices.SymbolWriter.MonoSymbolFile.CheckGuidMatch (Guid other, System.String filename, System.String assembly) [0x00000] in <filename unknown>:0 at Mono.CompilerServices.SymbolWriter.MonoSymbolFile..ctor (System.String filename, Mono.Cecil.ModuleDefinition module) [0x00000] in <filename unknown>:0 at Mono.CompilerServices.SymbolWriter.MonoSymbolFile.ReadSymbolFile (Mono.Cecil.ModuleDefinition module, System.String filename) [0x00000] in <filename unknown>:0 at Mono.Cecil.Mdb.MdbReaderProvider.GetSymbolReader (Mono.Cecil.ModuleDefinition module, System.String fileName) [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleReader.ReadSymbols (Mono.Cecil.ModuleDefinition module, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleReader.CreateModuleFrom (Mono.Cecil.PE.Image image, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 at Xamarin.Android.Tuner.DirectoryAssemblyResolver.ReadAssembly (System.String file) [0x00000] in <filename unknown>:0 (Persevy.Android)

  • JohnWilson.4976JohnWilson.4976 AUMember ✭✭
    edited February 2015

    @PaulBetts thanks for swinging by :smiley:

    My BlobCache.LocalMachine.GetType() results look like

    BlobCache.LocalMachine.GetType()
    {Akavache.Sqlite3.SQLitePersistentBlobCache}
        base: {System.Reflection.TypeInfo}
        Assembly: {System.Reflection.MonoAssembly}
        AssemblyQualifiedName: "Akavache.Sqlite3.SQLitePersistentBlobCache, Akavache.Sqlite3, Version=4.1.0.0, Culture=neutral, Publ…"
        BaseType: {System.MonoType}
        ContainsGenericParameters: false
        DeclaringMethod: System.InvalidOperationException: DeclaringMethod can only be used on generic arguments
        DeclaringType: (null)
        FullName: "Akavache.Sqlite3.SQLitePersistentBlobCache"
        GUID: {System.Guid}
        IsConstructedGenericType: false
        IsGenericParameter: false
        IsSecurityCritical: false
        IsSecuritySafeCritical: false
        IsSecurityTransparent: true
        MemberType: System.Reflection.MemberTypes.TypeInfo
        Module: {System.Reflection.MonoModule}
        Name: "SQLitePersistentBlobCache"
        Namespace: "Akavache.Sqlite3"
        ReflectedType: (null)
        StructLayoutAttribute: {System.Runtime.InteropServices.StructLayoutAttribute}
        TypeHandle: {System.RuntimeTypeHandle}
        UnderlyingSystemType: {System.MonoType}
    
    

    and I took a screenshot of what the object looks like in the debugger:

    (that image looks broken, but if you click on it, it brings it up just fine)

    The path /data/data/com.blah.Mobile/cache/blobs.db doesn't exist anywhere on my phone though. Why?

    @TimSneed I'm not creating a platform specific instance of anything, since all the Akavache bits seem to be resolved at the shared library level. Is this a requirement?

  • JohnWilson.4976JohnWilson.4976 AUMember ✭✭

    @PaulBetts thanks for swinging by :smiley:

    My BlobCache.LocalMachine.GetType() results look like

    BlobCache.LocalMachine.GetType()
    {Akavache.Sqlite3.SQLitePersistentBlobCache}
        base: {System.Reflection.TypeInfo}
        Assembly: {System.Reflection.MonoAssembly}
        AssemblyQualifiedName: "Akavache.Sqlite3.SQLitePersistentBlobCache, Akavache.Sqlite3, Version=4.1.0.0, Culture=neutral, Publ…"
        BaseType: {System.MonoType}
        ContainsGenericParameters: false
        DeclaringMethod: System.InvalidOperationException: DeclaringMethod can only be used on generic arguments
        DeclaringType: (null)
        FullName: "Akavache.Sqlite3.SQLitePersistentBlobCache"
        GUID: {System.Guid}
        IsConstructedGenericType: false
        IsGenericParameter: false
        IsSecurityCritical: false
        IsSecuritySafeCritical: false
        IsSecurityTransparent: true
        MemberType: System.Reflection.MemberTypes.TypeInfo
        Module: {System.Reflection.MonoModule}
        Name: "SQLitePersistentBlobCache"
        Namespace: "Akavache.Sqlite3"
        ReflectedType: (null)
        StructLayoutAttribute: {System.Runtime.InteropServices.StructLayoutAttribute}
        TypeHandle: {System.RuntimeTypeHandle}
        UnderlyingSystemType: {System.MonoType}
    
    

    and I took a screenshot of what the object looks like in the debugger:

    (that image looks broken, but if you click on it, it brings it up just fine)

    The path /data/data/com.blah.Mobile/cache/blobs.db doesn't exist anywhere on my phone though. Why?

    @TimSneed I'm not creating a platform specific instance of anything, since all the Akavache bits seem to be resolved at the shared library level. Is this a requirement?

  • TimSneedTimSneed USUniversity ✭✭
    edited February 2015

    @tkowalczyk & @wislon here is an example of what I am talking about. This works on both my iPhone and nexus 7 tablet when I restart the device. Each device returns a different guid (of course) but on start and stop, it will return the same Guid.


    I actually did stop and watch a few minutes of television before firing this up again.

    https://github.com/trsneed/Xamarin.IoC

    Am I close to what you are talking about? I know it probably isn't exactly what you are looking for, but I think it is a start. I personally have zero experience with storyboards in Xamarin.Forms, but I think the dependency locator could probably help.

    Special thanks to @RobGibbens for having some IOC ready Xamarin Forms code that I didn't have to build myself.

  • TimSneedTimSneed USUniversity ✭✭
    edited February 2015

    @wislon on your comment about the requirement to have a platform specific implementation of Akavache, I think you do have to. @PaulBetts has a nice blog post that goes into the concept of implementing platform specific code in the platform specific portion of the app (the android project or iOS project) and putting the xplat code in the core library. http://log.paulbetts.org/the-bait-and-switch-pcl-trick/

    In this instance a dependency on IBlobCache that your service / view model can work with which is instantiated in the platform specific version of your app is a good solution. This is helpful because Android/iOS/and WinPhone handle caching or SQLite differently.

    It is important to remember that compile time resolution means little in the world of xplat development (my opinion).

    Another good resource is Daniel Plaisted had a great talk at evolve 2014 on PCL development.

  • JohnWilson.4976JohnWilson.4976 AUMember ✭✭

    @timsneed thanks for the input. I actually put a project together to repro the problem, and of course it works perfectly. I can't get it to fail the same way that this other app is failing. It's weird, because it points to something we've implemented, but we've not actually implemented that much! :)

    The Akavache platform-specific nuget packages you have to add to the Android (or iOS) project actually take care of all the instantiation of the platspec stuff (using precisely that bait-and-switch method). So there's actually no work for the developer to do at any level. Basically it's add the nuget packages to shared lib and platspec app, build and go. B&S takes care of the rest, and it's one of the reasons I like Akavache so much! :smiley:

    Something else is going on in the broken app; one of my colleagues mentioned that maybe one of the other packages we're using (ModernHttpClient perhaps) may be messing with the Splat locator registrations somehow. Something for me to take a look at later when I'm under less pressure. I'll report back here when I figure it out.

  • TimSneedTimSneed USUniversity ✭✭
    edited February 2015

    @wislon cheers! just throwing out thoughts at that problem. Could be a number of things :)

  • JohnWilson.4976JohnWilson.4976 AUMember ✭✭

    @TimSneed thanks mate, every little bit helps! One never knows when it might turn out to be just the one line of code that the other guy put in his source code which causes the facepalm moment for the guy with the problem :)

    @tkowalczyk : the (working) example app is up on github at https://github.com/wislon/xam-akavache-test if you want to see another example. I've been using ReactiveUi for the front end bit, but if you're not familiar with that, it's OK, because it actually has zero to do with setting up the cache and reading/writing to it. It works perfectly, so ignore that readme for now :)

  • tkowalczyktkowalczyk PLMember, University ✭✭

    @TimSneed thank you for your samples and contributions to this topic I will also try your sample and get back here.
    @wislon so I think that the problem is somewhere in Xamarin.Forms because I am using Akavache in this framework, I will check your sample too, now I am in crunch a little bit a had to move to couchbase for this project to deliver stuff on time ;/

  • JohnWilson.4976JohnWilson.4976 AUMember ✭✭

    @tkowalczyk I'm getting into a crunch here too.
    I've got to solve this soon or I'll be moving to something like couch myself (not tried it yet tho!) :smiley:

  • JohnWilson.4976JohnWilson.4976 AUMember ✭✭

    @tkowalczyk OK, I've found a workaround that fixes the problem for me. Doesn't explain why the cache gets wiped or reinitialised in one project, and works perfectly in another tho. It's just weird.

    I tried it from @TimSneed 's angle and manually instantiated an SQlitePersistentBlobCache, giving it a specific path to create the DB files at a path I can control and see (via GetExternalFilesDir(null).AbsolutePath + "test.db) and that worked!

    It still doesn't explain why I had the original problem, but right now this is an acceptable solution for me.

    I've updated the solution on github (ar https://github.com/wislon/xam-akavache-test ) - just have a look at the instantiate-blobcache branch, the readme says where to look.

    Thanks guys! :smiley:

  • ScottSmith.8058ScottSmith.8058 USMember, University

    Hey guys. I am trying to test out Akavache 4.1.0 in a Xamarin.Forms app. When I try to install the nuget package into a default solution using Xamarin.Forms 1.3.2.6316 the package installs in the PCL and the Windows Phone projects but fails to install in the Android and iOS projects. From the error message below, it is obviously failing on the dependent package, Rx-Interfaces 2.2.5.

    Here is the issue:
    Could not install package 'Rx-Interfaces 2.2.5'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v2.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

    Could not install package 'Rx-Interfaces 2.2.5'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

    Has anyone else run into this with this version of Akavache?
    Thanks

  • mattwardmattward GBMember Xamurai

    Rx-Interfaces 2.2.5 has PCLs which are compatible with Android and iOS Unified projects so it should install without any errors.

    Possible reasons why it might fail:

    • Xamarin PCL profiles are not installed.
    • NuGet Package manager is not up to date.

    Although if you managed to create a new Xamarin.Forms project from scratch then the above possible reasons should not be affecting you.

  • ScottSmith.8058ScottSmith.8058 USMember, University

    I checked that package manager is up to date and it appears to be. I am update to date with the stable release of Xamarin and have the latest Forms nuget packages. So, I think things are all up to date. I tried to install just the Rx-Interfaces 2.2.5 package and received the same error. Kind of stumped.

  • ScottSmith.8058ScottSmith.8058 USMember, University

    BTW. I am using Visual Studio 2013 Ultimate with Update 4 with Mac build host integration.

  • mattwardmattward GBMember Xamurai

    @ScottSmith.8058 - Can you try running a test console app? The source code is on GitHub or you can download the addin file, rename it to .zip, and extract the monopcl.exe. This console app is essentially a cut down version of NuGet which can list the PCL profiles on your machine or run a simple framework compatibility check.

    I would be interested in the output from both the following commands:

    monopcl list
    monopcl match MonoAndroid22
    

    With the first command I would expect to see some PCL profiles with MonoAndroid, MonoTouch and Xamarin.iOS. The second command should return some PCL profiles that are compatible.

  • ScottSmith.8058ScottSmith.8058 USMember, University

    I am not seeing any MonoAndroid, MonoTouch and Xamarin.iOS profiles listed. Is there an issue with my Xamarin install? Or is it my VS install?

  • mattwardmattward GBMember Xamurai

    @ScottSmith.8058 - Xamarin will install its own PCL profiles if there were PCLs already available when it was installed. There should be Xamarin .xml files in some of the PCL directories, such as:

    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile78\SupportedFrameworks
    

    On my machine I have the following files:

    .NET Framework 4.5.xml
    Windows 8.xml
    Windows Phone Silverlight 8.xml
    Xamarin.Android.xml
    Xamarin.iOS.Unified.xml
    Xamarin.iOS.xml
    

    Probably the easiest way to get the Xamarin profiles installed is to repair the Xamarin installation from Programs and Features.

    Repair Xamarin

  • ScottSmith.8058ScottSmith.8058 USMember, University

    So this is very strange. On my work computer, the one with the issue, these files are not there. I ran the repair and they are still not there. However, on my personal mac laptop that is running Windows 8.1 in a VM they are there and I have not problems install the Akavache NuGet packages.

    Can I just copy them over? With that work or is there some registration that needs to be done?

  • mattwardmattward GBMember Xamurai

    Copying the files over should be fine. There is no extra registration for the profile .xml files.

  • ScottSmith.8058ScottSmith.8058 USMember, University

    Yep. Copying them over seemed to do the trick. Akavache NuGet packages installed in all projects and it seems to be working as expected. Thanks for the help!

  • MattPerry.5470MattPerry.5470 GBMember

    My issue that that once in the cache GetAndFetchLatest always uses the cached version even when the timespan is set at say 10 seconds.

    var cachedBoardz = cache.GetAndFetchLatest("boardz", () => GetRemoteBoardzAsync(),
    createdAt => DateTimeOffset.Now - createdAt > TimeSpan.FromSeconds(10));

    I can invalidate the cache and it will work but then the timespan never expires the cache

  • LalitSuranaLalitSurana INUniversity

    I have scourged the net and tried every suggestion. I cannot make Akavache to work with Xamarin Forms. Even though it is NOT using InMemory, all data is gone after application restart.

    Tomasz did you ever get this to work? Would anyone have a very basic sample project on xamarin forms where akavache has actually worked?

  • TektonTekton USMember ✭✭✭
    edited August 2015

    @LalitSurana @PaulBetts https://github.com/akavache/Akavache/issues/238 You could double check your SQLite3 references, as suggested in that issue, but I think it's more to do with SQLite.raw_basic (could be wrong though). Not exactly sure so far, other than to say I bet your other providers are still using the InMemoryBlobCache.

  • tkowalczyktkowalczyk PLMember, University ✭✭

    @LalitSurana I could not get this working so I moved to another solution.

«1
Sign In or Register to comment.