Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Can't get git package depdencies to work

Discussion in 'Package Manager' started by Peter77, Dec 13, 2020.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,640
    I created a package that depends on another package. Both of these packages are on github and are private repositories.

    UnityScenePostProcessingPipeline
    has a dependency to
    UnityScriptableObjectContainer
    .

    The
    UnityScenePostProcessingPipeline
    package.json file contains this dependency:
    Code (CSharp):
    1.   "dependencies": {
    2.     "com.oddworm.scriptableobjectcontainer": "https://github.com/pschraut/UnityScriptableObjectContainer.git#1.0.0"
    3.   },
    1.0.0
    is a tag in the UnityScriptableObjectContainer git repository. I'm able to install the
    UnityScriptableObjectContainer
    package when I use above link
    https://github.com/pschraut/UnityScriptableObjectContainer.git#1.0.0
    via "Add package from git URL..." in Package Manager.

    However, when I try to install the
    UnityScenePostProcessingPipeline
    package from git, Unity outputs the following error to the Console window:
    Code (CSharp):
    1. Cannot perform upm operation: Unable to add package [https://github.com/pschraut/UnityScenePostProcessingPipeline.git]:
    2.   Package com.oddworm.sceneprocessingpipeline@https://github.com/pschraut/UnityScenePostProcessingPipeline.git has invalid dependencies or related test packages:
    3.     com.oddworm.scriptableobjectcontainer (dependency): Version 'https://github.com/pschraut/UnityScriptableObjectContainer.git#1.0.0' is invalid. Expected a 'SemVer' compatible value. [NotFound]
    4. UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    5.  
    If I install
    UnityScriptableObjectContainer
    using the above link through Package Manager first and then
    UnityScenePostProcessingPipeline
    , no error occurs. But I actually want that the editor pulls the dependency automatically rather than asking the user to install various packages in a specific order.

    I feel like I've tried all combinations I found in the documentation for the dependency URL, all output the same error, I tried:
    Code (CSharp):
    1. https://github.com/pschraut/UnityScriptableObjectContainer.git#1.0.0
    2. https://github.com/pschraut/UnityScriptableObjectContainer.git
    3. https://github.com/pschraut/UnityScriptableObjectContainer
    4. git+https://github.com/pschraut/UnityScriptableObjectContainer.git#1.0.0
    5. git+https://github.com/pschraut/UnityScriptableObjectContainer.git
    6. git+https://github.com/pschraut/UnityScriptableObjectContainer
    7. git://github.com/pschraut/UnityScriptableObjectContainer.git#1.0.0
    8. git://github.com/pschraut/UnityScriptableObjectContainer.git
    9. git://github.com/pschraut/UnityScriptableObjectContainer
    10.  
    Any idea what the problem could be?
     
  2. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,324
    You can't have git dependencies defined on git packages

     
    Peter77 likes this.
  3. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    https://docs.unity3d.com/2020.1/Documentation/Manual/upm-git.html
    If you do want to use Git dependencies for your private repository, please check out this package: https://openupm.cn/packages/com.coffee.upm-git-extension/?subPage=readme
     
  4. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464