Git Product home page Git Product logo

Comments (13)

anaisbetts avatar anaisbetts commented on September 27, 2024

Looking into this, but the right way to do what you're doing is:

var sb = await BlobCache.LocalMachine.LoadImageFromUrl(source);
image.SetSource(sb.ToNative());

from splat.

anaisbetts avatar anaisbetts commented on September 27, 2024

Yo @dsplaisted, why do WPA81 apps care about versioning like this? Neither Splat nor Akavache are strong named, so it should load any version of the assembly that matches the simple name, right?

from splat.

anaisbetts avatar anaisbetts commented on September 27, 2024

@factormystic This should be fixed, update both Akavache and Splat

from splat.

factormystic avatar factormystic commented on September 27, 2024

Sweet, thanks

from splat.

factormystic avatar factormystic commented on September 27, 2024

@paulcbetts just calling image.SetSource(sb.ToNative()); doesn't directly work, due to cannot convert from 'Windows.UI.Xaml.Media.Imaging.BitmapSource' to 'Windows.Storage.Streams.IRandomAccessStream'.

Do I need to be using something to give me an extension method to make that happen, perhaps?

...

In any case, I have updated both akavache and splat, and get another TypeInitializationException for this same code:

{System.TypeInitializationException: The type initializer for 'Akavache.Sqlite3.Internal.SQLiteConnection' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'SQLitePCL.raw, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
   at Akavache.Sqlite3.Internal.SQLiteConnection..cctor()
   --- End of inner exception stack trace ---
   at Akavache.Sqlite3.Internal.SQLiteConnection..ctor(String databasePath, Boolean storeDateTimeAsTicks)
   at Akavache.Sqlite3.SQLitePersistentBlobCache..ctor(String databaseFile, IScheduler scheduler)
   at Akavache.Sqlite3.Registrations.<>c__DisplayClass6.<Register>b__0()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at Akavache.Sqlite3.Registrations.<>c__DisplayClass6.<Register>b__1()
   at Splat.ModernDependencyResolver.GetService(Type serviceType, String contract)
   at Splat.DependencyResolverMixins.GetService[T](IDependencyResolver This, String contract)
   at Akavache.BlobCache.get_LocalMachine()
   at (my program here)

I found a SQLitePCL.raw.dll in packages\SQLitePCL.raw_basic.0.5.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid+MonoTouch and added a reference to it in my project. That blew up at runtime as follows:

Something went wrong in the build configuration.  This is the bait assembly, which is for referencing by portable libraries, and should never end up part of the app.  Reference the appropriate platform assembly instead.

so I removed that reference and tried the ones in packages\SQLitePCL.raw_basic.0.5.0\build\wpa81\cppinterop_sqlite3_dynamic\arm and \x86 instead. They also blew up before compiling, with:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture, "x86" (or "arm" for when I tried that one),

So I'm still stuck.

I even tried uninstalling, deleting the all the akavache & related packages from that folder, and reinstalling, but at this point I'm just cargo-culting because I don't know how to actually fix this.

from splat.

factormystic avatar factormystic commented on September 27, 2024

Oh, should this go back to the Akavache issue? I had already forgotten there were two issues and that was even from this morning...

from splat.

anaisbetts avatar anaisbetts commented on September 27, 2024

In your compiler warnings, it tells you that you can't use "AnyCPU", you have to choose either "x86" or "ARM", because SQLite3 is a native DLL. You also need on WPA81 to reference the MSVCRT Runtime for Windows Phone or else it won't work either:

windows 8 1 - parallels desktop 2014-08-09 10-22-16 2014-08-09 10-22-20

Sorry that Windows Phone sucks

from splat.

factormystic avatar factormystic commented on September 27, 2024

Alright, it seems to be working now, thanks. I think it would be a good idea to write down all of the extra manual steps to get it working, perhaps in the readme, so it's obvious for the next person.

from splat.

anaisbetts avatar anaisbetts commented on September 27, 2024

@factormystic Send a PR to Akavache?

from splat.

factormystic avatar factormystic commented on September 27, 2024

Good idea.

FYI this is suuuuper awkward to manage when writing a real app, because you constantly have to change the build target between x86 and arm when deploying to a vm vs an actual device. Awkward enough to not really be wanting to use this library at all, in fact. If there was a non-sqlite mode, even with reduced performance, but that worked for Any CPU, that would be preferable.

from splat.

ghuntley avatar ghuntley commented on September 27, 2024

TL;DR make sure you have the build configuration set correctly.

out

= Android + iPhoneSimulator

from splat.

Rajivhost avatar Rajivhost commented on September 27, 2024

Hi, I experience the same issue. I'm working on NET45, installed Akavache 4.1.1 and Splat 1.6.2 but I still have this 'System.TypeInitializationException'
image

from splat.

HEBOS avatar HEBOS commented on September 27, 2024

Hi, I spent 24 hours on this and came with the result, that it is working in RELEASE mode only with following conditions:

  1. Microsoft C++ 2013 referenced (Add reference, win 8.1, Microsoft C++ 2013 Runtime...)
  2. Install support for SQLITE (Tools - Extensions and Updates)
  3. In project options do not check "Enable optimizations"
  4. If running on simulator, set Target processor to x86
  5. If running on device, set Target processor to ARM
    Note: I found no way to make it working in DEBUG mode

from splat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.