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

SQLitePlatformAndroid and SQLitePlatformIOS instantiation fails #358

Open
blmiles opened this issue May 19, 2017 · 6 comments
Open

SQLitePlatformAndroid and SQLitePlatformIOS instantiation fails #358

blmiles opened this issue May 19, 2017 · 6 comments

Comments

@blmiles
Copy link

blmiles commented May 19, 2017

Hello,

var sqlitePlatform = new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid();
OR
var sqlitePlatform = new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformIOS();

both cause this error:
"VTable setup of type SQLite.Net.Platform.XamarinAndroid.SQLiteApiAndroid failed"
OR
"VTable setup of type SQLite.Net.Platform.XamarinIOS.SQLiteApiIOS failed"

All refs and using statements correct. I can instantiate a SQLiteConnnection if I put this directly into the args: new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid() but not by creating a sqlitePlatform first to add as an arg for the SQLiteConnection(platform, path)

This is in a Xamarin Forms shared project.

Another explanation is here:
https://forums.xamarin.com/discussion/95904/sqlite-net-connections-and-xamarin-forms#latest

Please advise if at all possible.

Thanks

@blmiles
Copy link
Author

blmiles commented May 20, 2017

Kudos to the guys fixing/maintaining SQLite.Net PCL and Extensions. Whoever patched those, you've solved this particular issue!

Thank you!

@ikiugu
Copy link

ikiugu commented May 29, 2017

Hi, @blmiles I still have this same issue, how do I fix it. This is in a Xamarin.iOS project

@blmiles
Copy link
Author

blmiles commented May 29, 2017

Actually, I didn't do anything.
I noticed the day after seeing this issue, package updates was showing an update for SQLite.Net and Extensions. Updated all.

Wait!

The update adds additional and duplicate packages so I deleted ALL packages related to SQLite.Net Extensions.
Re-added the SQLite.Net Extensions package only, it finds and adds the dependencies it needs.
Build, run, all works.

That's why I assumed someone had updated the either/both packages.

@ikiugu
Copy link

ikiugu commented May 29, 2017

So I update SQLite.Net then delete all packages related to .Net Extensions then add the SQLite.Net Extensions separately?

@blmiles
Copy link
Author

blmiles commented May 29, 2017

Update all SQLite related packages.
Once done, check package list for duplicates but it should not harm removing all SQLite related packages then add SQLite.Net Extensions only. OR only SQLite.Net-PCL if you're not already using or intend to use SQLite.Net Extensions.
No guarantee that'll help but that worked for me and eliminated that error.

@ikiugu
Copy link

ikiugu commented May 29, 2017

Okay, thanks. Let me try that.

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

2 participants