Akavache
Akavache copied to clipboard
Xamarin.Forms Droid application is crashing when trying to use Akavache
Describe the bug
I am trying to get an old Xamarin Forms application up and running. It's been pretty painful and on the verge of giving up. The application fails when trying to execute: await BlobCache.LocalMachine.Invalidate
This only happens when I try to run the droid version of the application. iOS works.
I am using Visual Studio for Mac 2019. I am using akavache 5.0. I can not use the latest version because the pcl project is using 'PCL profile 4.5 / Profile 78'. I can't update it because it's just going to shoot everything to crap. (Make it worse than it is now).
System.DllNotFoundException: /system/lib/libsqlite.so assembly:1[T].ViaFactory (System.Threading.LazyThreadSafetyMode mode) [0x00043] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Lazy.cs:333 at System.Lazy
1[T].ExecutionAndPublication (System.LazyHelper executionAndPublication, System.Boolean useDefaultConstructor) [0x00022] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Lazy.cs:351
at System.Lazy1[T].CreateValue () [0x00074] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Lazy.cs:431 at System.Lazy
1[T].get_Value () [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Lazy.cs:509
at Akavache.Sqlite3.Registrations+<>c__DisplayClass6.<Register>b__1 () [0x00000] in <62f381ebb54b44df949b4ae3da486002>:0
at Splat.ModernDependencyResolver.GetService (System.Type serviceType, System.String contract) [0x00039] in /Users/paul/code/paulcbetts/splat/Splat/ServiceLocation.cs:271
at Splat.DependencyResolverMixins.GetService[T] (Splat.IDependencyResolver This, System.String contract) [0x00000] in /Users/paul/code/paulcbetts/splat/Splat/ServiceLocation.cs:151
at Akavache.BlobCache.get_LocalMachine () [0x00000] in C:\projects\akavache\src\Akavache\Portable\BlobCache.cs:65
at Sir.SessionService.Login (System.Func`1[TResult] getAuthenticatedUser) [0x000c4] in /Users/n/Desktop/Source Code/SIR-Mobile/mobile/Sir/Services/SessionService.cs:77
at Sir.LoginViewModel.TryLogIn () [0x00039] in /Users/n/Desktop/Source Code/SIR-Mobile/mobile/Sir/ViewModels/LoginViewModel.cs:68
Expected behavior
Uh, I guess I'd like for it to work.
Screenshots
Environment
- Device: Droid API > 23 Additional context
I have seen this has been a persistent issue for quite a while. I've added sql-net-pcl, etc.
Any other help/insight would be appreciated
Hey @Nathan187 :wave:,
Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider contributing financially.
https://opencollective.com/reactiveui
PS.: We offer
priority
support for all financial contributors. Don't forget to addpriority
label once you start contributing :smile:
An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms!
I can sympathize but not sure there is much we can do if your using that fairly old version.
I will give a go though. Looks like the native library libsqlite.so is not being found. You might want to match whatever is in akavache 5 and include the .so as a android native reference.
do you know of a document or something that would describe how to do that? thanks for your response
https://docs.microsoft.com/en-us/xamarin/android/platform/native-libraries
thanks glen...i'm trying to hunt down that file .so file and i'll give it a shot
i want to say thank you for answering and at least trying to help.
i actually got it to work. many post all suggest a common thing. remove all sqlite references/packages. when i uninstalled and reinstalled akavache 5.0, it dependent on some sqlite packages. i saw one person finding success when installing the SQLiteNetExtensions. That seems to have done the trick.
Sadly, I'm working on another issue now but it's further and less frustrated that where I was the other day.
Again, thanks for your help!