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

Cannot install on a Xamarin Android projet #516

Closed
nbelley opened this issue Apr 9, 2021 · 4 comments
Closed

Cannot install on a Xamarin Android projet #516

nbelley opened this issue Apr 9, 2021 · 4 comments
Labels

Comments

@nbelley
Copy link

nbelley commented Apr 9, 2021

I'm using netstandard 2.1 in my data access project, so everything installs fine. The database I'm using is sqlite, but when try to install the package on the android app project, it doesn't work:

Severity Code Description Project File Line Suppression State Error Could not install package 'Microsoft.Data.SqlClient.SNI.runtime 2.1.1'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v11.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.

I would be nice to have a package that can be used in mobile apps!

@borisdj
Copy link
Owner

borisdj commented Apr 9, 2021

This seems to be problem because of Microsoft.Data component, so they would have to address the issue.
In the meanwhile what you could do is fork the code and in project replace Microsoft.Data.SqlClient with System.Data.SqlClient then rebuild the library like another user have already done: DUPE of Xamarin.iOS build failed with Link Sdk Assembliies
Here it says that is should be supported (but had another error): EF Core 3.1.2 in Xamarin.Android

@nbelley
Copy link
Author

nbelley commented Apr 15, 2021

Just to conclude, I did what was recommended in the linked post. I also had to remove the packages NetTopologySuite and direct references to it (in Sql server adapters anyway, which won't be used on mobile).

Right now I'm in final tests and it seems to work perfectly for SQLite.

Thanks for you help!

@nbelley nbelley closed this as completed Apr 15, 2021
@borisdj
Copy link
Owner

borisdj commented Apr 15, 2021

So eventually you made it with work with Microsoft.Data ?
And besides removing NetTopologySuite what else exactly did you do that you said was recommended in the linked post?

@nbelley
Copy link
Author

nbelley commented Apr 15, 2021

Replace nuget package Microsoft.Data.SqlClient with System.Data.SqlClient!

Commentend the code that could not be translated, with netpopolgy, mostly geometry stuff only for sql server anyway.

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

No branches or pull requests

2 participants