Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include SocketIOUnity as a dependency in package.json #57

Open
royibernthal opened this issue Apr 21, 2023 · 3 comments
Open

Include SocketIOUnity as a dependency in package.json #57

royibernthal opened this issue Apr 21, 2023 · 3 comments

Comments

@royibernthal
Copy link

royibernthal commented Apr 21, 2023

I created a custom package that's using SocketIOUnity.
I'm now trying to add SocketIOUnity to my package.json so that it can be resolved as a dependency.

I tried this:

"dependencies": {
  "com.itisnajim.socketiounity": "https://github.com/itisnajim/SocketIOUnity.git"
}

And got the following error:

[Package Manager Window] Cannot perform upm operation: Unable to add package [https://github.com/my-package.git]:
  Package my-package@https://github.com/my-package.git has invalid dependencies or related test packages:
    com.itisnajim.socketiounity (dependency): Version 'https://github.com/itisnajim/SocketIOUnity.git' is invalid. Expected a 'SemVer' compatible value. [NotFound].
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

It seems git urls are only supported in the project manifest though.

I also tried this:

"dependencies": {
  "com.itisnajim.socketiounity": "1.1.4"
}

And got the following error:

[Package Manager Window] Cannot perform upm operation: Unable to add package [https://github.com/my-package.git]:
  Package my-package@https://github.com/my-package.git has invalid dependencies or related test packages:
    com.itisnajim.socketiounity (dependency): Package [[email protected]] cannot be found [NotFound].
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

Which makes sense, as I don't believe this package has been pushed to any registry that unity is fetching from.

How would you do it?

@itisnajim
Copy link
Owner

tbh i don't have any idea this,

editing manifest.json inside Packages folder by adding the dependency maybe should work:

{
  "dependencies": {
    "com.itisnajim.socketiounity": "https://github.com/itisnajim/SocketIOUnity.git"
  }
}

Save the manifest.json file, and the Unity Package Manager should automatically resolve and install the SocketIOUnity package, if it didn't then close and open unity. otherwise i don't know!

@royibernthal
Copy link
Author

Hmm yeah of course, but each user would have to do tha, it's equivalent to installing it via the Package Manager manually via Unity. It can't really by change upon package installation, correct me if I'm wrong.

@itisnajim
Copy link
Owner

try doing this, and tell me if its fixed, in your dependency do edit manifest.json inside Packages folder

{
  ...
  "dependencies": {
    "com.itisnajim.socketiounity": "https://github.com/itisnajim/SocketIOUnity.git"
  }
  ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants