cathei / BakingSheet

Easy datasheet management for C# and Unity. Supports Excel, Google Sheet, JSON and CSV format.
MIT License
346 stars 34 forks source link

com.unity.nuget.newtonsoft-json 3.0.2/Newtonsoft.Json 13.0.1 causing dependency version mismatch when importing .unitypackage #8

Closed alihandroid closed 2 years ago

alihandroid commented 2 years ago

Hello,

Thanks for developing this awesome package 😄 Unity installs the 3.0.2 version of their JSON package, which uses Newtonsoft.Json 13.0.1, even though this package depends on the 2.0 one. I imagine this is because we're using 2021 LTS, mainly for its new features and improved Android stability.

I am unable to rollback to the previous version and it seems this was an informed decision on Unity's side.. It seems you can manually install 2.0.0 from Package Manager > Add package by name, or edit Packages/manifest.json manually on Unity versions that don't have that option. However, this might be an issue for people who use Unity's Version Control package as it depends on Unity's Newtonsoft Json package. Unity isn't good at dealing with different versions of the same package coexisting.

I managed to get rid of the errors by upgrading all the Google.Apis.* packages to their latest version while using the 3.0.2 version. As for future releases, I can think of several solutions but I'm unsure which one would be the best course of action.

  1. Upgrade com.unity.nuget.newtonsoft-json dependency from 2.0 to 3.0
  2. Keep the old version but add a reminder to the readme that you have to install the 2.0.0 version if Unity installs 3.0+ manually. Also maybe explain that you need to download the latest versions of the DLLs yourself for 3.0 support.
  3. Release multiple versions of the .unitypackage, one supporting com.unity.nuget.newtonsoft-json 2.0 and the other 3.0

I feel like the first option makes the most sense, as the 2.0 docs says it's meant for internal development but the 3.0 docs don't, but I'd love to hear your opinion on it too.

cathei commented 2 years ago

Thank you for reporting it! Yes, because of same issue, I recently updated Json.NET versions to 13.0.1 with other dependencies. Here is Changelog.

Also I fixed some issue with AOT compilers, so please use latest version -> Release Again, let me know anytime if you have issue!

alihandroid commented 2 years ago

I meant to install 3.4.2 but I must have installed 3.4.0 accidentally while checking the upgrade guide. Sorry for the useless issue 😂

Downloading 3.4.3 now, really rapid development here 👍