applejag / Newtonsoft.Json-for-Unity

Newtonsoft.Json (Json.NET) 10.0.3, 11.0.2, 12.0.3, & 13.0.1 for Unity IL2CPP builds, available via Unity Package Manager
https://github.com/jilleJr/Newtonsoft.Json-for-Unity
MIT License
1.15k stars 128 forks source link

Bug: invalid dependencies: jillejr.newtonsoft.json-for-unity: no such package available: jillejr.newtonsoft.json-for-unity #59

Open slowDrag0n opened 4 years ago

slowDrag0n commented 4 years ago

Expected behavior

Adding dependencies in manifest.json as explained in "Installation guide via UPM" should list the package in package manager allowing it to be installed in the project.

Actual behavior

Adding dependencies in manifest.json as explained in "Installation guide via UPM" gives the error invalid dependencies: jillejr.newtonsoft.json-for-unity: no such package available: jillejr.newtonsoft.json-for-unity which in does NOT list the package in UPM rendering it impossible to install the package.

Steps to reproduce

{
  "scopedRegistries": [
    {
      "name": "Packages from jillejr",
      "url": "https://npm.cloudsmith.io/jillejr/newtonsoft-json-for-unity/",
      "scopes": ["jillejr"]
    }
  ],
  "dependencies": {
    "jillejr.newtonsoft.json-for-unity": "12.0.3",

    // ...
  }
}

// ... signals the rest of the packages you have in the manifest.json, such as all the "com.unity.*" dependencies

Details

Windows 10 1909 build 18363.752. Tried on Unity 2018.2.10f1, 2017.4.20f1, 2019.3.14f1.

Unity build target ANDROID

Newtonsoft.Json-for-Unity package version 12.0.3

Checklist

applejag commented 4 years ago

Interesting case! Thanks for submitting this, and with such a wide range of tested Unity versions!

Could you try navigate to the cloudsmith endpoints via your browser to see if there's any connection issues at play? Just a sanity check. Try both:

After that could you upload your entire manifest.json? Just as another sanity check, so I can try it with the exact same setup

slowDrag0n commented 4 years ago

Interesting indeed. I installed this using the exact guideline a a few months ago on 2018.4.20f1 and it worked flawlessly then (sorry i meant 2018.4.20f1 earlier instead of 2017). Now everything is the same except that i cant add it in 19.3.14f1 and neither in any other project in same version(2018). pretty weird.

Anyhow, both links open without any issues, the second only shows this: {"db_name": "registry", "data_size": 4900688, "doc_count": 6, "committed_update_seq": 1588714857, "compact_running": false, "disk_format_version": 6, "disk_size": 4900688, "doc_del_count": 0, "instance_start_time": "1592212932", "purge_seq": 0, "update_seq": 1588714857} not sure if thats intentional.

Here's my manifest.json:

{
  "scopedRegistries": [
    {
      "name": "Packages from jillejr",
      "url": "https://npm.cloudsmith.io/jillejr/newtonsoft-json-for-unity/",
      "scopes": [
        "jillejr"
      ]
    }
  ],
  "dependencies": {
    "jillejr.newtonsoft.json-for-unity": "12.0.3",
    "com.unity.cinemachine": "2.5.0",
    "com.unity.collab-proxy": "1.2.16",
    "com.unity.ide.rider": "1.1.4",
    "com.unity.ide.vscode": "1.1.4",
    "com.unity.test-framework": "1.1.11",
    "com.unity.textmeshpro": "2.0.1",
    "com.unity.timeline": "1.2.13",
    "com.unity.ugui": "1.0.0",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
  }
}

PS: Thanks for all the work you put in this. such an amazing and useful resource that you created. God bless you.

applejag commented 4 years ago

Thank you! :)

And I see the issue now. The latest 12.0.3 version of Json .NET is actually found in the package version 12.0.301.

What you can do is to keep the scoped registry but remove the dependency from the list, then you can actually find the package in the package manager UI and install it from there. Otherwise just changing to 12.0.301 will resolve the issue. Sorry for little confusing versioning ;)

And yes that endpoint is meant to return raw JSON, it's just the actual API that Unity calls in the background with bunch of different parameters

slowDrag0n commented 4 years ago

sorry for late reply. is it working by only adding the scoped registry on your end. its still not working for me im afraid. adding only the scoped registry does nothing at all. while adding the project dependency even with 12.0.301 as version. it still gives me the same error :(

is it possible that it may have something to do with the way my unity is installed. firewall or something? if so, any pointers on how that may be fixed?

applejag commented 4 years ago

I am unable to reproduce your issue here. I took your entire manifest.json and just replaced the version with 12.0.301 and it worked. I've tested on Unity 2019.3.3f1 and 2019.3.14f1.

So don't know what's going on there.


What you could do it explore the second option I mentioned there where you try with only the scopedRegistry and not the package in your manifest.json. So like this:

{
  "scopedRegistries": [
    {
      "name": "Packages from jillejr",
      "url": "https://npm.cloudsmith.io/jillejr/newtonsoft-json-for-unity/",
      "scopes": [
        "jillejr"
      ]
    }
  ],
  "dependencies": {
    // rest of unity package
    // but no jillejr.newtonsoft.json-for-unity package
  }
}

And then in the package manager you could actually search for the "Json.NET 12.0.3 for Unity" package and install it from there.

image

Try that and tell me if you encounter more issues, such as if it for some reason does not appear in the list

slowDrag0n commented 4 years ago

thanks. only adding scoped registry made it possible for the package to appear in search and to be installed. did so successfully on 2019 versions (2019.3 & 4) but since 2018's package manager dont have search so still no install there (same error)

applejag commented 4 years ago

Ok could you post your latest manifest.json that fails in Unity 2018? I am unable to reproduce with the info I have currently.

laurentopia commented 4 years ago

this won't work - not showing in search - on unity 2020.1 image

{
  "scopedRegistries": [
    {
      "name": "Packages from jillejr",
      "url": "https://npm.cloudsmith.io/jillejr/newtonsoft-json-for-unity/",
      "scopes": [
        "jillejr"
      ]
    }
  ],
  "dependencies": {
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.2d.tilemap": "1.0.0",
    "com.unity.analytics": "3.3.5",
    "com.unity.collab-proxy": "1.3.8",
    "com.unity.ide.rider": "1.2.1",
    "com.unity.ide.visualstudio": "2.0.2",
    "com.unity.ide.vscode": "1.2.1",
    "com.unity.test-framework": "1.1.14",
    "com.unity.textmeshpro": "3.0.0-preview.1",
    "com.unity.timeline": "1.2.6",
    "com.unity.ugui": "1.0.0",
    "com.unity.xr.legacyinputhelpers": "2.1.4",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
  }
}
applejag commented 4 years ago

@laurentopia Ah Yea in Unity 2020 I believe you have to check in the "My registries" category. Have not had the time to test the flow with 2020.1 so much yet

mattbenic commented 3 years ago

Hi :) I have the same issue as above, running in 2018.2.21f1:

A re-import of the project may be required to fix the issue or a manual modification of D:/BSC/HAZID/Hazid.app/HazID.AdminPortal/Packages/manifest.json file.

and displays an error in the packagemanager:

![Unity Package Manager Error](https://uc7be2ba33321d585b3e57c33649.previews.dropboxusercontent.com/p/thumb/AA6DhDXPdLt8fCYgzpal1DCf8_1XnDe7J1UhjSuDrfjeN6koLD3_bQ6TERo4emMPbVsOushcekOpTyF2gfg_SI36iuZ1MdJWIz-gHp0gLhM7418DzyKT6kdGeJdzRt1FZLUIWVs9tfAqCFyxFaPmPrkHWx0qfE1IGbB4HqLrkwORZdZK6OZVDSNWMuVcwR2oDRNeqhFwf7ml2R493LkLNlIThDTbdCTSlYVPpk8cNinPkox1QMicLqA76brHrwQeU-gTrtbe9JtPOeIN2Api9qB9IwxoetdE9xyX0jr1uK7UiUjVCGxq5i5pIAXQ8euhHRjnf9GkSpOrYGBvOKg4gaWSPJXBz41qD_5xzQp67tl20PMj14LH4Z_OwzlUktfbk5Q98qw3km29fPVd7xKE5MBb/p.png?fv_content=true&size_mode=5)

- If I only add the scoped registry:

```json
{
  "scopedRegistries": [
    {
      "name": "Packages from jillejr",
      "url": "https://npm.cloudsmith.io/jillejr/newtonsoft-json-for-unity/",
      "scopes": [ "jillejr" ]
    }
  ],
  "dependencies": {
    "com.unity.ads": "2.0.8",
    "com.unity.analytics": "2.0.16",
    "com.unity.package-manager-ui": "1.9.11",
    "com.unity.purchasing": "2.0.3",
    "com.unity.textmeshpro": "1.2.4",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
  }
}

The package does not appear at all in the UPM window, and since there is no search available in this version of Unity I can't find it.

I can access both the main cloudsmith link and the cloudsmith hosted manifest link in the browser.

(For reference, I was able to add the package and download it in 2019.3.8f1, but I can't update my project to that version)

applejag commented 3 years ago

@laurentopia Hmm curious. If it's a Unity version thing I'll have to double-check the comparability of perhaps the package.json file or so.