Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Include Xamarin Android and iOS in NuGet Packages #255

Closed
dvoituron opened this issue May 22, 2016 · 10 comments
Closed

Include Xamarin Android and iOS in NuGet Packages #255

dvoituron opened this issue May 22, 2016 · 10 comments

Comments

@dvoituron
Copy link

I tried successfully your excellent new library with Xamarin Andoid. But I need to add a reference manually. Can you configure your NuGet package definition to include MonoAndroid and Xamarin.iOS (see https://developer.xamarin.com/guides/cross-platform/advanced/nuget).
All dependencies are already included in Mono framework.

See here a sample of the NuGet Package Explorer result.

image

@rowanmiller rowanmiller added this to the 1.0.1 milestone May 23, 2016
@rowanmiller
Copy link
Contributor

We'll probably just wait for Xamarin to catch up with netstandard NuGet changes, but leaving open to look at post 1.0.0

@natemcmaster
Copy link
Contributor

natemcmaster commented Aug 4, 2016

Xamarin has announced support now for .NET Standard. https://blog.xamarin.com/net-standard-library-support-for-xamarin/. Some basic scenarios work, and using Xamarin + Visual Studio I've been able to get a simple Xamarin.iOS/Android app working...

...but with a few hacks. There are still bugs in Microsoft.Data.Sqlite.

Known issues on Xamarin

@wjvii
Copy link

wjvii commented Aug 5, 2016

Is there any update now on using EF Core with Xamarin now that Xamarin supports netstandard? I see a few related entries here on GitHub where people are trying to use EF Core with the latest Xamarin supporting netstandard and running into issues and in particular it seems with Microsoft.Data.Sqlite and its related packages.

Specifically Xamarin states they are now supporting netstandard but I keep running into this: Could not install package 'SQLite.Native 3.12.2'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

So is this an issue with the package or Xamarin because that package on NuGet.org says it is netstandard1.0 compatible.

@natemcmaster
Copy link
Contributor

@wjvii this is one of the known issues I referenced in my previous comment: #255 (comment) (see natemcmaster/libsqlite3-package#6). I am working with the sqlite team to release an update to the SQLite package that resolves the issue.

@ericsink
Copy link

FWIW, I think this issue might be more complicated than just needing netstandard support.

The NativeMethods/pinvoke stuff might work okay for iOS as long as you're not using any callbacks anywhere. (I haven't checked.)

But the new rules with Android N make it basically essential to bundle a SQLite library rather than use the one provided by the OS.

Long term, supporting Xamarin probably means dealing with a lot of the same issues as SQLitePCL.raw (which I maintain).

As part of my exploration of this area, I have submitted pull request #292, in which I rip out the current interop stuff and replace it with a SQLitePCL.raw dependency. For discussion purposes.

@natemcmaster
Copy link
Contributor

The NativeMethods/pinvoke stuff might work okay for iOS as long as you're not using any callbacks anywhere.

We don't yet, but we've played with callbacks and may add them. #143

But the new rules with Android N make it basically essential to bundle a SQLite library rather than use the one provided by the OS.

How does SQLitePCL.raw distribute sqlite for Android N?

@ericsink
Copy link

How does SQLitePCL.raw distribute sqlite for Android N?

Bundling a native lib for Xamarin.Android requires placing the .so files into an embedded resource in an assembly.

For use with SQLitePCL.raw, I maintain a set of SQLite builds which are called "e_sqlite3", to eliminate ambiguity with the system SQLite.

The id for the e_sqlite3 package containing the embedded library assembly for Android is SQLitePCLRaw.lib.e_sqlite3.android

An implementation of ISQLite3Provider specifies that "e_sqlite3" is the desired library. Providers are in packages with id starting with SQLitePCLRaw.provider.*

I have bundle packages which, for each target framework or platform, contain dependencies on the lib and the appropriate provider packages. Plus an init function which injects the provider into the core assembly so everything is ready to go.

@divega
Copy link

divega commented Oct 12, 2016

@bricelam are we still planning to do anything about this for 1.1.0-preview1?

@bricelam
Copy link
Contributor

I don't think it fits into 1.1.0-preview1, but we could look at it before 1.1.0 RTMs.

@bricelam bricelam modified the milestones: 1.1.0, 1.1.0-preview1 Oct 12, 2016
@rowanmiller rowanmiller modified the milestones: 1.2.0, 1.1.0 Oct 12, 2016
@bricelam
Copy link
Contributor

After #21, I don't think there'll be anything left to do on our side to support Xamarin.

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

No branches or pull requests

7 participants