robertohuertasm / SQLite4Unity3d

SQLite made easy for Unity3d
MIT License
1.28k stars 265 forks source link

Add uwp support via the dlls #75

Closed jwittner closed 6 years ago

jwittner commented 6 years ago

I extracted these DLLs from the official download here: https://sqlite.org/2017/sqlite-uwp-3210000.vsix

I used this in a HoloLens project to much success.

robertohuertasm commented 6 years ago

Hi @jwittner, thanks for this PR! I'm doubting about accepting it because I would normally use sqlite dlls via nuget when dealing with UWP projects. What would be the benefit of having the dlls here in the project? Why didn't you choose to install them via nuget? (I'm just curious about it 😜)

jwittner commented 6 years ago

When building UWP apps from Unity we can't preserve the UWP solution that Unity generates. By putting the UWP dlls into this project I'm able to create UWP builds for my Unity project. Specifically, my team builds HoloLens projects and these dlls enabled us to use your awesome library. =)

If we were building a raw UWP application I'd totally agree, cause then we wouldn't be using the SQLiteForUnity3d project.

Does that make sense?

robertohuertasm commented 6 years ago

I guess people will be able to use these dlls or others if they want so... merged! Thanks!

sabasoft commented 6 years ago

I am getting some issues while running the example project on unity5.3.4f1 targeting universal windows 10 build. "Assets\Scripts\SQLite.cs(1584,47): error CS0731: The type forwarder for type 'Windows.Storage.ApplicationData' in assembly 'Windows' causes a cycle Assets\Scripts\SQLite.cs(1584,47): error CS1069: The type name 'ApplicationData' could not be found in the namespace 'Windows.Storage'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly. Assets\Scripts\SQLite.cs(225,51): error CS0731: The type forwarder for type 'Windows.Storage.ApplicationData' in assembly 'Windows' causes a cycle Assets\Scripts\SQLite.cs(225,51): error CS1069: The type name 'ApplicationData' could not be found in the namespace 'Windows.Storage'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly."

I have successfully created builds targeting WP 8.1 and targeting UWP 8.1 platforms but getting error when doing this for UWP 10.Any Help would be really appreciated. Thanks

jwittner commented 6 years ago

Looks like that code is only enabled in NETFX_CORE - is that the runtime you're trying to run against? I used this in a UWP 10 build, but we targeted NET_2_0_SUBSET.

sabasoft commented 6 years ago

Thanks for your reply, I did not changed any thing in player settings, Can you send me the screen shot of what player settings is required against successful building for UWP 10?

sabasoft commented 6 years ago

capture I have tried to build by switching compilation overrides to "Use Dot Net Core Partially" but got same errors. I am really struggling to solve this. Please help me on this ASAP.Thanks

jwittner commented 6 years ago

I don't have such an old build of Unity available to me. Can you send me a capture of your player properties and maybe I can suss out what you need set?

sabasoft commented 6 years ago

Sure sending it to you. capture 2

Which unity version you have used to make the build? other than this please let me know which visual studio version you have used and the windows 10 sdk version too.

robertohuertasm commented 6 years ago

Can you discuss this in #77? It would be easier for other users to follow and help. 😉