Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite3 not provided on Android N #311

Open
vinidiktov opened this issue Jun 21, 2016 · 23 comments
Open

SQLite3 not provided on Android N #311

vinidiktov opened this issue Jun 21, 2016 · 23 comments

Comments

@vinidiktov
Copy link

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
Copy link

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
Copy link
Owner

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

@michaeldimoudis
Copy link

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
Copy link

JaridKG commented Jul 6, 2016

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

@bgmeiner
Copy link

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
Copy link

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
Copy link

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
Copy link

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

@Machinarius
Copy link

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
Copy link

admaiorastudio commented Aug 30, 2016

As I understand, libsqlite.so will be:

  • still accessibile in Android N when targeting Android SDK 23 or less. It will only show a logcat error.
  • not accessibile in Android N when targeting Android SDK 24+
  • not accessibile in future releases of Android

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
Copy link

@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
Copy link

SlyNet commented Sep 12, 2016

any updates on this? @oysteinkrog ?

@michaeldimoudis
Copy link

@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
Copy link

hvaughan3 commented Sep 25, 2016

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
Copy link

Any news on this issue? @oysteinkrog

@SlyNet
Copy link

SlyNet commented Sep 29, 2016

we switched to sqlite-net-pcl.

@JKennedy24
Copy link

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

@MKuckert
Copy link

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

@JKennedy24
Copy link

JKennedy24 commented Oct 19, 2016

@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
Copy link

PankitPatel commented Nov 24, 2016

@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
Copy link

MKuckert commented Nov 24, 2016

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
Copy link

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
Copy link

Any new fix or workaround on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests