Newtonsoft.Json-for-Unity icon indicating copy to clipboard operation
Newtonsoft.Json-for-Unity copied to clipboard

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

Open slowDrag0n opened this issue 5 years ago • 11 comments

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

  • New project
  • Open file (project-directory)/Packages/manifest.json
  • modify the file as below:
{
  "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

  • Unity will produce the error invalid dependencies: jillejr.newtonsoft.json-for-unity: no such package available: jillejr.newtonsoft.json-for-unity

  • Unity suggests re-importing the project. On re-importing the project, and error dialog appears stating the same error and giving options to Retry, Quit, or Continue (clicking this keeps showing the error in console after)

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

  • [x] Shutdown Unity, deleted the /Library folder, opened project again in Unity, and problem still remains.
  • [x] Checked to be using latest version of the package.

slowDrag0n avatar Jun 12 '20 09:06 slowDrag0n

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:

  • https://cloudsmith.io/~jillejr/repos/newtonsoft-json-for-unity/packages/
  • https://npm.cloudsmith.io/jillejr/newtonsoft-json-for-unity/

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

applejag avatar Jun 15 '20 07:06 applejag

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.

slowDrag0n avatar Jun 15 '20 09:06 slowDrag0n

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

applejag avatar Jun 15 '20 10:06 applejag

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?

slowDrag0n avatar Jun 17 '20 12:06 slowDrag0n

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

applejag avatar Jun 24 '20 16:06 applejag

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)

slowDrag0n avatar Jun 29 '20 08:06 slowDrag0n

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

applejag avatar Jun 29 '20 13:06 applejag

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"
  }
}

laurentopia avatar Jul 28 '20 09:07 laurentopia

@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

applejag avatar Jul 28 '20 17:07 applejag

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

  • If I add the scoped registry and dependency (using 12.0.301):
{
  "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.301",
    "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"
  }
}

unity logs the error:

An error occurred while resolving packages:
  Project has invalid dependencies:
    jillejr.newtonsoft.json-for-unity: Package [[email protected]] cannot be found

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

  • If I only add the scoped registry:
{
  "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)

mattbenic avatar Sep 18 '20 08:09 mattbenic

@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.

applejag avatar Sep 18 '20 11:09 applejag