Custom Package dependecies are not shown or pulled down

I’ve seen similar things asked a few times, but I didn’t find any solutions for my issue. (My fear that this is not yet working…)

I have a registry setup for our custom packages. Unity is setup correctly to see them, I can pull them down, install, etc. All good there.

My issue is that I have a custom package that depends on another custom package and few preview packages, and none of them get pulled down. I am trying to make this work with 2019.4, but I also tried 2020.1(.7) and no luck.

If understand correctly, all I need to do is list dependencies in the package.json. But that doesn’t work. I linked required Assembly Definitions. Not really sure what else is there to do.

Any suggestions? Or is this something that is still not ready?

Note: I 2020.1 there is dependency UI element, but that is always empty for me

You need to write the scope for the custom dependencies, say you have two packages com.scope1.a and com.scope2.b, and a depends on b. You need a registry list like

        {
            "name": "Tools",
            "url": "https://mycompany.example.com/tools-registry",
            "scopes":['com.scope1', 'com.scope2']
        }

Something similar Package with dependency from another scopedRegistry

I hope Packman gets improved so at least it can search dependencies for you when you have not specified the scope manually.

hm, interesting. All of my packages are in the same scope actually, but i have not specified scope explicitly like it is in your snippet. Does that go into the package.json or manifest.json?

manifest.json

Could you print your manifest.json file, or try specifying the scope manually?

yep, my manifest has this:

{
    "scopedRegistries": [
    {
      "name": "companyArtifactory",
      "url": "http://artifactory.ops.aws.company.net/artifactory/api/npm/unity_packages",
      "scopes": [
        "com.company"
      ]
    }
  ],
  "dependencies": {
    "com.company.testpackageproject": "0.0.27",
    ....
}

I specified scopes in all of the package.json and manifests, but no luck. It’s so frustrating.

So, I have project A that has only Unity dependencies. I have project B that has dependency on A. And project C that depends on B. This screen shot shows that project C thinks project B has no dependencies.

I assume you mean package a, b, and c (not project).
A => unity packages
B => A
C => B

Now you seems to show me a screenshot #8 of the package.json of package c? It tells the package c has no dependencies. And of course, screenshot #1 tells you no dependence is found.

Can you print the package.json (raw json) of package C? Maybe here’s a typo.

The package.json inspector is to define the direct dependencies (screenshot #8)

The unity packman view shows direct dependencies only.

In a real-world setup.

com.littlebigfun.addressable-importer package depends on com.unity.addressables

com.unity.addressables depends on several Unity packages.

Only direct dependencies are displayed.

So, A and B are packages (but also Unity projects), and C is a project. It’s the end project. So it doesn’t have a package.json of its own.

Here is the package.json for package A (I call it dependencypackageproject)

{
  "name": "com.company.dependencypackageproject",
  "displayName": "Some Company Unity Dependency Test Package",
  "version": "0.1.218",
  "unity": "2019.4",
  "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris interdum, nibh vitae tempus lacinia, turpis ante venenatis urna, quis vulputate dui lacus varius arcu. Suspendisse commodo maximus efficitur. Cras bibendum venenatis posuere. Praesent suscipit enim in erat facilisis consectetur. Quisque semper elementum sapien, vitae dictum ipsum vulputate non. Aenean aliquam orci enim, in venenatis quam sollicitudin nec. Nullam scelerisque lectus sit amet ornare hendrerit. Donec nec nisi in velit pellentesque iaculis a ut dolor.",
  "dependencies:": {
    "com.unity.vectorgraphics": "2.0.0-preview.12"
  },
  "publishConfig": {
    "registry": "http://artifactory.ops.aws.company.net/artifactory/api/npm/unity_packages"
  },
  "scopes": [
    "com.company"
  ],
  "timestamp": 1602778929211,
  "timestamp_readable": "Thu, 15 Oct 2020 16:22:09 GMT"
}

Here is the package.json for the package B (i call it testpackageproject)

{
  "name": "com.company.testpackageproject",
  "displayName": "Some Company Unity Test Package",
  "version": "0.0.27",
  "unity": "2019.4",
  "description": "Some Company test package.",
  "dependencies:": {
    "com.company.dependencypackageproject": "0.1.218",
    "com.unity.vectorgraphics": "2.0.0-preview.12"
  },
  "devDependencies:": {
    "com.company.dependencypackageproject": "0.1.218",
    "com.unity.vectorgraphics": "2.0.0-preview.12"
  },
  "publishConfig": {
    "registry": "http://artifactory.ops.aws.company.net/artifactory/api/npm/unity_packages"
  },
  "scopes": [
    "com.company"
  ],
  "timestamp": 1602779095826,
  "timestamp_readable": "Thu, 15 Oct 2020 16:24:55 GMT"
}

And the manifest for C is above. I hope this helps.

I should mention that I am using 2019.4 for our development, but for testing these things I tried also 2020.1.7. If this only works with 2020, I am ok with upgrading. We are not that far into our development, so i think it’s fairly safe.

I’m not sure what you mean that package A/B is also a project?

I’m also not sure if devDependencies, scopes, those are valid property or not?

Other stuff looks ok. You should be able to see the dependencies list in the inspector of package.json of package B.