Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Package Manager custom repo include issue

Discussion in 'Editor & General Support' started by moose0847, Sep 28, 2023.

  1. moose0847

    moose0847

    Joined:
    Dec 26, 2019
    Posts:
    33
    I'm currently setting up a unity project to host all my shared packages, and am running into an error I'm not clear on how to solve.

    First up I have a project with the following folder setup and package.json file
    upload_2023-9-28_4-53-23.png upload_2023-9-28_4-53-35.png

    Next, I have another project with this line in the manifest file
    upload_2023-9-28_4-54-16.png

    However, when I launch the editor, I get this error

    An error occurred while resolving packages:
    Project has invalid dependencies:
    com.mycompany.core: Version 'https://github.com/mycompany/sh-unitypackages?path=/Assets/com.mycompany.core' is invalid. Expected one of: a 'SemVer' compatible value; a value starting with 'file:'; a Git URL starting with 'git:' or 'git+', or ending with '.git'.

    I've replaced the company name with "mycompany" for the sake of example, but in the full setup all the spelling is correct and otherwise identical. Has anyone ever encountered this issue? I'm wondering if the path is throwing things off based on the error, but everything else looks fine.
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    What parts of this have you not tried?

    The http address is the github website, not the repository. Put in the repository URL, the one you would use to git clone.
     
  3. moose0847

    moose0847

    Joined:
    Dec 26, 2019
    Posts:
    33
    I think I found the issue, forgot ".git" at the end of the url, like so. upload_2023-9-28_7-2-42.png

    Thought now the repository can't be found, which seems to be due to this being a private repository. From a bit of searching it seems like I need to setup an OAuth token, manage SSH keys, or some kind of credentials file. Is this a new thing? I don't seem to remember needing this when I did a setup like this in the past.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Just setup SSL keys and be done with it.

    It's sort of expected these days using git.

    Yes you can use HTTPS but it requires a lot more fiddling and fails on a lot of toolchains without a lot of very-custom workarounds.
     
  5. moose0847

    moose0847

    Joined:
    Dec 26, 2019
    Posts:
    33
    Fair enough, I'm able to get the ssh authentication working and connect to github successfully, but I get the following error:

    Unable to add package [git@github.com:mycompany/sh-unitypackages.git?path=/Assets/com.mycompany.core]:
    Error when executing git command. no such identity: /c/Users/Computer/.ssh/id_ed2551: No such file or directory
    git@github.com: Permission denied (publickey).
    fatal: Could not read from remote repository.

    Now the issue is that the key file is at /c/Users/Computer/.ssh/id_ed25519, but unity seems to be reporting that the key it's checking is cutting off the last number. Is this just a display error in the console or is unity cutting off the last character and that is causing the failure?
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Sounds like you didn't complete SSL key setup.

    You'll know it works when you can do a
    git clone
    and get the repo in question fully.
     
  7. moose0847

    moose0847

    Joined:
    Dec 26, 2019
    Posts:
    33
    ok I managed to find the issue, turned out to be a typo in my config file. Everything seems to be working great now, thanks for all your help @Kurt-Dekker