SQLite-Net-PCL Bait issue

Ok - I've just started a new iOS application complete with PCL so that I can add an Android version in due course. I need to use SQLite-Net and so I installed the PCL (found here https://www.nuget.org/packages/sqlite-net-pcl) to both projects, i.e. PCL and iOS as instructed (Xamarin Uni).

I've created a few models and a repository in the PCL project and am trying to instantiate from iOS but I get the 'This is the bait' error which apparently indicates that I've not added the package to my platform specific project - but I have.

I've uninstalled and reinstalled, cleaned, rebuilt and even restarted Xamarin Studio (I'm running on a Mac) - so what's going on?

The exact error is:
This is the 'bait'. You probably need to add on the SQLitePCLRaw.bundle_* packages to your platform project.'

Looking at the solution I can see that SQLitePCLRaw.bundle_green is in fact referenced (along with sqlite-net-pcl, SQLitePCLRaw.core and SQLitePCLRaw.provider.sqlite3.ios_unified).

So all the bits seem to be in place but obviously something is not wiring up properly - any ideas?

Thanks in advance

Best Answer

Answers

  • Gigantor2015Gigantor2015 CAMember ✭✭

    I am having this same problem, has anyone come up with a different solution? This is really blocking me at the moment.

  • BrianKillenBrianKillen USMember ✭✭

    Eric, i had the same problem and rolled back to the 1.2.1 version of sqlite and it solved my problem.

  • Gigantor2015Gigantor2015 CAMember ✭✭

    @DaveCarson Following the three steps you listed did the trick. Thank you for your help!

    @BrianKillen Thanks for your response!

  • I had the same problem, fixed with the instructions of @DaveCarson , thanks!

  • Vivek.zymrVivek.zymr INMember

    This works perfectly for me thanks @DaveCarson.

  • AaronClausen.0025AaronClausen.0025 USMember ✭✭

    Has anyone seen this working yet with iOS 11?

    I've been getting this same "this is the bait" error and have followed all of Dave's steps above several times (clean, reboot, remove all nuget packages, delete obj/bin folders, ensure all my PCL nuget packages are on the latest versions, install only the unified nuget package as mentioned by Dave above etc). But to no avail, my iPhone 7 is still shutting the app and throwing the "this is the bait" error in the Visual Studio output window...

    Any other ideas anyone :( ?

  • MartinClarkeMartinClarke GBMember
    edited November 21

    I encountered this issue as well, but I resolved it simply enough by installing the sqlite-net-pcl package to both the class library containing the database access and to the platform specific projects. At time of writing, it appears the package is clever enough to identify the platform specific dependencies it needs to install, which makes the task that much easier!

    The solution offered by @DaveCarson was also very helpful in fully resolving the issue :smiley:

Sign In or Register to comment.