-
Notifications
You must be signed in to change notification settings - Fork 112
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
SQLitePCLRaw.lib.e_sqlite3.android support of .NET Standard 2.0 #615
Comments
I would need to get more specifics here. SQLitePCLRaw supports .NET Standard 2.0 already, and has for a long time. Nonetheless, I get a steady stream of people saying it doesn't work well with Unity. And since I'm not a Unity developer, I've never worked through the issues to get it fixed. In principle, I'd like Unity support to work well. But I'm not sure that "support .NET Standard 2.0" == "good Unity support", unless you have more specific info to explain that. |
Thanks for the quick reply. Of course. Let me break it down. But first need to specify, that I am talking specifically about SQLitePCLRaw.lib.e_sqlite3.android. It doesn't have
It is, no issues with that. But only Short answerYes, "support .NET Standard 2.0" == "good Unity support" is Detailed answerLets break the Unity's world down.
I added some SQLitePCLRaw packages to UnityNuGet in 2022 and used them as a charm in Unity project for Windows. Today I want to make it work for Android and iOS as well. The last lost jigsaw piece is the native android lib files that I manually exported from your android package for now. All what I need is to have |
I just pushed up a prerelease to nuget.org which contains a little change for this issue. Does it work? |
Hi, At first, I tried with the version 2.1.10, using the .net6.0 android provider. Of course I wasn't able to build from Unity, because I got errors during the build... Here is a step by step tutorial for anyone that want to add SQLitePCL Raw to a Unity project by hand without using any other tool than Unity:
using UnityEngine;
public class InitSQLitePCL : MonoBehaviour
{
private void Awake()
{
SQLitePCL.Batteries_V2.Init();
Debug.Log("Batteries_V2.Init() done!");
}
}
Now you can Build & Run on Android! I tested with an Android 14 phone. |
Thank you @ericsink for your incredible work and for the years of maintenance and updates of all these pages, that is very impressive!
I just want to ask to add support of
.NET Standard 2.0
toSQLitePCLRaw.lib.e_sqlite3.android
package. I hope it won't be too complicated.The goal
It will let Unity developers to use the package in Unity project. Unity has restrictions to support only .NET Standard 2.0 (and 2.1 in newer versions of Unity).
Prove of concept
I downloaded and unpacked Android libraries from the
SQLitePCLRaw.lib.e_sqlite3.android
package. Manually included them into Unity project, then combined it with set ofSQLitePCLRaw
packages. Made builds in Unity for multiple different platforms in combination withEntityFrameworkCore
set of packages I earlier added to UnityNuGet (Nuget alternative for Unity, because Unity isn't able to work with original Nuget).And in the end I proved the functionality in builds for the next platforms:
Will do MacOS test later as well, it is less important because statistically it is very low amount of players in the world who plays on MacOS.
Almost done creating the bundle package (inspired by your bundle packages) that will let Unity developers to include "ready to go" bundle with EFCore + SQLitePCLRaw packages that will just work. For now the package contains pure android libs which I grabbed from your package, which is not ideal. They shouldn't be there, that is why I am asking you to add the
.NET Standard 2.0
support.Thanks in advance!
The text was updated successfully, but these errors were encountered: