oysteinkrog / SQLite.Net-PCL

Simple, powerful, cross-platform SQLite client and ORM - Updated version with PCL support
MIT License
353 stars 162 forks source link

SQLite3 not provided on Android N #311

Open alexvinidiktov opened 8 years ago

alexvinidiktov commented 8 years ago

https://developer.xamarin.com/releases/android/xamarin.android_6/xamarin.android_6.1/#mono-data-sqlite

Eric Sink also wrote about this: https://github.com/ericsink/SQLitePCL.raw/wiki/SQLite-net-and-Android-N

michaeldimoudis commented 8 years ago

Yep this is a very important update that's required. For reference, the repo this library forked from (praeclarum/sqlite-net) has already made the changes required: https://github.com/praeclarum/sqlite-net/commits/master

oysteinkrog commented 8 years ago

Indeed, this seems like a big problem. So the solution would be to use SQLitePCL.raw/SQLitePCL.bundle_green/

michaeldimoudis commented 8 years ago

Thanks for the info. Do we have to wait for an updated Nuget package? Or can we just add the SQLitePCL.raw/SQLitePCL.bundle_green/ Nuget packages to our solution and it will just work?

JaridKG commented 8 years ago

Do the SQLitePCL packages replace the packages? Or is this going to be updated for Nougat?

bgmeiner commented 8 years ago

Hi any news on this issue? I updated my Xamarin today (beta channel) and now I can't start the apps with SQLite anymore...

Any workaround for the time being other then reverting back to the older Xamarin versions?

philipag commented 8 years ago

Same issue here. For now I downgraded back to the Xamarin release channel, but I think this will soon become a problem for lots of people once the beta goes to release.

michaeldimoudis commented 8 years ago

I just tested my Xamarin Forms app on Android 7.0 that uses: SQLite.Net-PCL SQLite.Net.Core-PCL SQLite.Net.Async-PCL

And it just works :)

philipag commented 8 years ago

It does not work with the current Xamarin Android beta. Release is OK.

Machinarius commented 8 years ago

I've switched the SQLite calls from the system SQLite to ericsink's Bundle_green embedded SQLite on my own fork of this project.

https://github.com/Machinarius/SQLite.Net-PCL https://www.nuget.org/packages/SQLite.Net-PCL-Green/3.1.1-AndroidN

Most tests pass and my app is behaving nicely with no warnings whatsoever regarding library usage on an Android Nougat emulator since i started using my fork instead of Oysten's nuget package.

Do handle with care and test your app thoroughly as i can NOT guarantee this simple string substitution trick will just work on all cases, mostly because the system SQLite library may be compiled with different flags. Also, the Nuget package was compiled using Oysten's master branch that may contain experimental code. DO TEST YOUR APP ON ANDROID N AND BELOW. DO IT. DON'T SKIP THIS STEP. PRETTY PLEASE DO NOT SKIP IT. YOU HAVE BEEN WARNED.

admaiorastudio commented 8 years ago

As I understand, libsqlite.so will be:

https://developer.android.com/about/versions/nougat/android-7.0-changes.html

Is there any update about this issue? @oysteinkrog are you planning to update the package to be compliant with Android N and future releases?

renefloor commented 8 years ago

@admaiorastudio That's right. That is also discussed in the urls of the first post and here: http://android-developers.blogspot.nl/2016/06/improving-stability-with-private-cc.html

As @oysteinkrog didn't update this library since november 2015 I'll go look for another library, for example @Machinarius version.

SlyNet commented 8 years ago

any updates on this? @oysteinkrog ?

michaeldimoudis commented 8 years ago

@Machinarius I tried to get your version working but I was unsuccessful. Do you have any pointers? Ie: what nuget packages to remove, if any, for yours to work? Any nuget packages I need to add extra? Any extra init() that has to happen like Batteries.init()? Any namespace changes? Thanks

hvaughan3 commented 8 years ago

Switched over to sqlite-net-pcl and everything is working great. Had to change my connection code, but sqlite-net-pcl is actually a lot more simple to get a connection with.

Only issue I found is the there is no DeleteAllAsync() but that is not such a big deal for me.

LuigiMaestrelli commented 8 years ago

Any news on this issue? @oysteinkrog

SlyNet commented 8 years ago

we switched to sqlite-net-pcl.

JKennedy24 commented 8 years ago

So is the solution - if we want our application to work on Android 7+ we need to swap to sqlite-net-pcl?

MKuckert commented 8 years ago

As long as this fork is not updated to also use SQLitePCLRaw: yes

JKennedy24 commented 8 years ago

@MKuckert What about Sqlite.Net-Extensions? (Which I notice you are an owner of).

The Nuget has a dependency on Sqlite.Net-PCL. So if I use the Extensions nuget I am stuck on this version so cant run my application on Android 7+. Is that correct?

Actually scratch that, I notice you have swapped over in the Alpha releases

PankitPatel commented 8 years ago

@michaeldimoudis I just tested my Xamarin Forms app on Android 7.0 that uses: SQLite.Net-PCL SQLite.Net.Core-PCL SQLite.Net.Async-PCL

And it just works :)

Tremendous solution and saved my day... Thanks...

Now it stopped working :(

MKuckert commented 8 years ago

May be it just works because Android N is not denying access to the libsqlite.so - contrary to their beta versions. You should see some log messages pointing that out.

renefloor commented 7 years ago

Keep in mind that Android M will deny access to the native libraries, so although things might look to work for now they will break.

UnreachableCode commented 6 years ago

Any new fix or workaround on this issue?