sqlite-net icon indicating copy to clipboard operation
sqlite-net copied to clipboard

Update to SQLitePCLRaw 3.0

Open ericsink opened this issue 3 months ago • 16 comments

This work is in progress, currently in a branch called raw3.

This will fix #1280 and #1272, which appear to be dupes of each other.

ericsink avatar Aug 19 '25 17:08 ericsink

One change in SQLitePCLRaw 3.0 is that I no longer build and distribute e_sqlcipher, so the package SQLitePCLRaw.bundle_e_sqlcipher is deprecated. So in this branch I have removed the corresponding sqlite-net nuget package.

ericsink avatar Aug 19 '25 19:08 ericsink

Another change in SQLitePCLRaw 3.0 is that SQLitePCLRaw.bundle_green is deprecated. It was always intended only for use by sqlite-net, and its presence causes all kinds of confusion, so I took the opportunity to get rid of it. I have implemented the same capability directly here in the raw3 branch.

ericsink avatar Aug 19 '25 19:08 ericsink

Thank you so much for your work @ericsink 😄

dartasen avatar Aug 21 '25 08:08 dartasen

@ericsink thank you so much. Can you please provide a tentative date as to when this will be done so I can plan my project development accordingly.

jerminContractor avatar Aug 22 '25 10:08 jerminContractor

Any day now, I hope. We're still sorting out transition issues for me getting more involved.

ericsink avatar Aug 22 '25 14:08 ericsink

Hey @ericsink do we have any timeline on this. Your last message says any day now, but it is 2 weeks old message. I was hoping we get it last week. No pressure really just asking.. I understand it is done when you get chance or solve it.

archergod avatar Sep 02 '25 13:09 archergod

I just need a couple things from @praeclarum but I'm having trouble getting in contact with him.

ericsink avatar Sep 02 '25 13:09 ericsink

Okay, here's something to try. I haven't tested this yet, but please tell me if it works.

  1. Remove the reference to sqlite-net-pcl and add the package sqlite-net-e. It's a pre-release.
  2. Add the package SourceGear.sqlite3 version 3.50.4.2.

The sqlite-net-e package is another form of sqlite-net, but instead of depending on SQLitePCLRaw.bundle_green, it depends on SQLitePCLRaw.config.e_sqlite3 version 3.0, which is configured to look for a library with e_sqlite3 as the base name, and SourceGear.sqlite3 provides that.

I still need to write up a better explanation, but I'm curious about feedback on this.

Note that this solution does not emulate the so-called "green" behavior, wherein the e_sqlite3 library is used everywhere but iOS. That implementation is done in a branch here, but I can't push it up to nuget.org without some help from @praeclarum .

ericsink avatar Sep 03 '25 02:09 ericsink

Hi @ericsink,

Many thanks for your investigations. I tried out your solution, but it didn't remove the 16 KB warning when I started the app.

Image

wolframliermann avatar Sep 05 '25 10:09 wolframliermann

Is the build out folder cleaned out? What version of the dotnet tools are you using? What other packages are in your project?

ericsink avatar Sep 05 '25 11:09 ericsink

Thank you! I will test this on Monday and then let you know.

wolframliermann avatar Sep 05 '25 11:09 wolframliermann

@ericsink Initial tests of the above approach seem to be working properly for my iOS and Android .NET 9.0 MAUI app (it removes the 16kb warnings and SQLit operations are functioning correctly) after swapping the NuGet packages:

<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />

with

<PackageReference Include="sqlite-net-e" Version="1.10.0-beta2" />
<PackageReference Include="SourceGear.sqlite3" Version="3.50.4.2" />

johncdoherty avatar Sep 07 '25 19:09 johncdoherty

@ericsink cleaning the project was the solution. It now works with MAUI 9.0 on Android and iOS without any warnings. Thank you!

wolframliermann avatar Sep 08 '25 08:09 wolframliermann

@ericsink Initial tests of the above approach seem to be working properly for my iOS and Android .NET 9.0 MAUI app (it removes the 16kb warnings and SQLit operations are functioning correctly) after swapping the NuGet packages:

<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />

with

<PackageReference Include="sqlite-net-e" Version="1.10.0-beta2" />
<PackageReference Include="SourceGear.sqlite3" Version="3.50.4.2" />

Works for me as well.

jirimatejka avatar Sep 12 '25 09:09 jirimatejka

Wouldn't it work with sqlite-net-base (https://www.nuget.org/packages/sqlite-net-base/1.10.196-beta) too and then using SQLitePCLRaw.config.e_sqlite3 3.0.2 and SourceGear.sqlite3 and SQLitePCLRaw.core 3.0.2

SQLitePCL.Batteries.Init(); needs to be called before first usage.

inforithmics avatar Sep 12 '25 13:09 inforithmics

@inforithmics Yes, I think that approach would work as well. Good point.

ericsink avatar Sep 12 '25 14:09 ericsink

I am building MAUI android app with dotnet 9, but also found myself with the same issue while deploying to play store/google play console even by running the app locally in debug mode: "Android 16 will require 16 KB page sizes, shared library 'libe_sqlite3.so' does not have a 16 KB page size. Please inform the authors of the NuGet package 'SQLitePCLRaw.lib.e_sqlite3.android' version '2.1.2' which contains...."

Below workaround solved the issue i am no longer seeing "16 KB page size ...." error in local testing/debugging through emulator. So, i am going to deploy on playstore i hope no issue will arise again.

I have uninstalled the problematic package, then in my project file (.csproj file) added 3 lines as in the attached txt file (when i paste the lines here they are not getting visible)

csproj contents.txt

Then run:

dotnet nuget locals all --clear

Then, manually delete:

1. YourProject/bin 2. YourProject/obj

Then run:

dotnet clean dotnet restore dotnet build -c Release -f net9.0-android dotnet publish -c Release -f net9.0-android

I hope it will help you too.

harigustave avatar Nov 26 '25 02:11 harigustave