Search Unity

Question Pin to specific version

Discussion in 'Package Manager' started by ImpossibleRobert, Apr 14, 2021.

  1. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    527
    Hi,

    I am referencing TextMeshPro 3.0.3 in my package.json but when used in Unity 2021.1 it will automatically pull in 3.0.4. Unfortunately this version has a bug so it is not usable for me.

    Until the bug is fixed I would like to force Unity to use 3.0.3. Is there any way to declare to use an exact version?
     
  2. Davidtr_Unity

    Davidtr_Unity

    Unity Technologies

    Joined:
    Mar 5, 2020
    Posts:
    34
    Hi,

    This is probably because your project manifest is referencing the version “3.0.4” of TextMeshPro. Make sure that the “com.unity.textmeshpro” entry is set to “3.0.3” in your "manifest.json" file, which is located under the “/Packages” directory of your project.

    I hope this is helpful!
     
  3. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    527
    Hi @Davidtr_Unity,

    as written in my text above, I am explicitly referencing 3.0.3 (both in my upstream dependency's package.json and in my projects manifest.json) but Unity 2021.1.3 is automatically selecting a newer version automatically. This is the root of the issue and I don't know how to solve that.

    Cheers, Robert
     
  4. Davidtr_Unity

    Davidtr_Unity

    Unity Technologies

    Joined:
    Mar 5, 2020
    Posts:
    34
    It could be that one or many other packages are requesting version 3.0.4. You can double check this by opening the “packages-lock.json” file with a text editor and searching for occurrences of
    "com.unity.textmeshpro": "3.0.4"
    . Each match will give you the name of a package depending on version 3.0.4.
     
  5. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    527
    Weirdly enough @Davidtr_Unity the only reference to textmeshpro comes from my SDK package which requires 3.0.3 and still Unity puts in 3.0.4 in the packages-lock.json. See attached file. Any ideas what could be going on?
     

    Attached Files:

  6. Davidtr_Unity

    Davidtr_Unity

    Unity Technologies

    Joined:
    Mar 5, 2020
    Posts:
    34
    I could not reproduce the behavior on my end. Could you also share your "manifest.json" file so I can have a look with the rest of the team?
     
  7. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    527
    Sure, here you go!
     

    Attached Files:

  8. supita_unity

    supita_unity

    Unity Technologies

    Joined:
    Dec 13, 2019
    Posts:
    226
    Hey @ImpossibleRobert, I'm sorry to see you are having this problem.

    A workaround for your problem could be set in your project manifest com.unity.textmeshpro to the version 3.0.3 as David said. I created a project using the manifest that you provided and I got traVRsal-sdk from your github repo. com.unity.textmeshpro gets bumped as you described, but adding it in the project manifest to com.unity.textmeshpro with version 3.0.3 ends up with the desired version.
    The issue is that com.unity.textmeshpro@3.0.4 is the verified version released with Unity 2021.1, that's why the version of the package gets updated to that specific version. I'm contacting the package author and letting him know, what is the problem that you are having on your end while using com.unity.textmeshpro@3.0.4? What version of Unity are you using?

    PS: com.unity.textmeshpro has released version 3.0.6, I'm not sure if using this version will fix the problem you are having, but you could give it a try.
     
    Last edited: May 6, 2021
    ImpossibleRobert likes this.
  9. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    527
    Hi @supitaUnity,

    I now tried the solution but I cannot confirm that it works. I have now defined the version in both sdk and project manifest and it is still auto-upgraded to 3.0.6. Even if I change it directly in the package-lock to 3.0.3 it is immediately upgraded again.

    To answer why this is important: new packages introduce unfortunately bugs that are sometimes not easy to reproduce. I have two cases now: TextMeshPro and Addressables.

    TMP: When switching from PC to Android build target 3.0.4 creates an endless loop of asset import, Unity states it cannot reproduce it easily but I am always willing to share my github project

    Addressables: I have to stay on 1.16.x since 1.17 introduced multiple bugs from which one is still left over and is a complete show stopper for my app (IN-1219). It doesn't help if that is a verified package for 1.17.17 (and is force upgraded in 2021.2). It is simply broken for me unfortunately and I need to work with the lower version.

    I really hope there is a way to fix that as otherwise I am stuck right now as I upgraded my project to 2021.1 but those two dependencies break everything without a way to solve it.

    In the past (2020.1) there was a way to see older versions as well, that seems to be gone in the package manager. Is there a secret parameter in the settings files maybe?

    Cheers, Robert
     
  10. supita_unity

    supita_unity

    Unity Technologies

    Joined:
    Dec 13, 2019
    Posts:
    226
    Hey, can you share an
    Hey @ImpossibleRobert,
    This behaviour you are describing definitely sound like a bug, could you file a bug with your particular project? I tried again to reproduce it today, but I couldn't with 2021.1.6f1

    upload_2021-5-12_10-54-31.png

    This is how my manifest looks like

    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.unity.2d.animation": "6.0.1",
    4.     "com.unity.2d.pixel-perfect": "5.0.0",
    5.     "com.unity.2d.psdimporter": "5.0.1",
    6.     "com.unity.2d.sprite": "1.0.0",
    7.     "com.unity.2d.spriteshape": "6.0.0",
    8.     "com.unity.2d.tilemap": "1.0.0",
    9.     "com.unity.collab-proxy": "1.3.9",
    10.     "com.unity.ide.rider": "3.0.6",
    11.     "com.unity.ide.visualstudio": "2.0.7",
    12.     "com.unity.ide.vscode": "1.2.3",
    13.     "com.unity.test-framework": "1.1.24",
    14.     "com.unity.textmeshpro": "3.0.3",
    15.     "com.unity.timeline": "1.5.4",
    16.     "com.unity.toolchain.macos-x86_64-linux-x86_64": "0.1.21-preview",
    17.     "com.unity.ugui": "1.0.0",
    18.     "com.unity.visualscripting": "1.5.2",
    19.     "com.wetzold.travrsal.sdk": "https://github.com/WetzoldStudios/traVRsal-sdk.git",
    20.     "com.unity.modules.ai": "1.0.0",
    21.     "com.unity.modules.androidjni": "1.0.0",
    22.     "com.unity.modules.animation": "1.0.0",
    23.     "com.unity.modules.assetbundle": "1.0.0",
    24.     "com.unity.modules.audio": "1.0.0",
    25.     "com.unity.modules.cloth": "1.0.0",
    26.     "com.unity.modules.director": "1.0.0",
    27.     "com.unity.modules.imageconversion": "1.0.0",
    28.     "com.unity.modules.imgui": "1.0.0",
    29.     "com.unity.modules.jsonserialize": "1.0.0",
    30.     "com.unity.modules.particlesystem": "1.0.0",
    31.     "com.unity.modules.physics": "1.0.0",
    32.     "com.unity.modules.physics2d": "1.0.0",
    33.     "com.unity.modules.screencapture": "1.0.0",
    34.     "com.unity.modules.terrain": "1.0.0",
    35.     "com.unity.modules.terrainphysics": "1.0.0",
    36.     "com.unity.modules.tilemap": "1.0.0",
    37.     "com.unity.modules.ui": "1.0.0",
    38.     "com.unity.modules.uielements": "1.0.0",
    39.     "com.unity.modules.umbra": "1.0.0",
    40.     "com.unity.modules.unityanalytics": "1.0.0",
    41.     "com.unity.modules.unitywebrequest": "1.0.0",
    42.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    43.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    44.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    45.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    46.     "com.unity.modules.vehicles": "1.0.0",
    47.     "com.unity.modules.video": "1.0.0",
    48.     "com.unity.modules.vr": "1.0.0",
    49.     "com.unity.modules.wind": "1.0.0",
    50.     "com.unity.modules.xr": "1.0.0"
    51.   }
    52. }
    53.  
    I restarted Unity, I even deleted the cache and restarted it again, but TMP stays in 3.0.3.

    If you could submit a bug from Unity with a demo project, your logs, it will help to check out what's going on your side. Also, if before submitting the bug you could set the Package Manager Log Level to "Debug" in the Preferences (see screenshot below) that will collect more information relevant to the Package Manager into the logs. To Submit the bug report you could do it from Help > Report a Bug...

    upload_2021-5-12_10-53-33.png

    Once the bug is submitted, please share the ticket number with us so I can follow up on it.

    Thanks in advance.
     
  11. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    527
    Is it possible @supitaUnity that the system gets confused if I pull in my SDK through a file reference? In my manifest I point to the locally checked out version of the SDK like that:

    "com.wetzold.travrsal.sdk": "file:../../traVRsal-SDK/Assets/SDK",
     
  12. supita_unity

    supita_unity

    Unity Technologies

    Joined:
    Dec 13, 2019
    Posts:
    226
    Nop, I still can't reproduce the issue on my side: I copied your travrsal checkout package from the project cache to outside of the project folder. I reused the same manifest.json with scope registries that you previously posted

    Code (CSharp):
    1. {
    2.   "scopedRegistries": [
    3.     {
    4.       "name": "Artees",
    5.       "url": "https://upm.artees.games:4873",
    6.       "scopes": [
    7.         "games.artees"
    8.       ]
    9.     },
    10.     {
    11.       "name": "Normal",
    12.       "url": "https://normcore-registry.normcore.io",
    13.       "scopes": [
    14.         "com.normalvr",
    15.         "io.normcore"
    16.       ]
    17.     }
    18.   ],
    19.   "dependencies": {
    20.     "com.normalvr.normcore": "2.0.3",
    21.     "com.unity.2d.sprite": "1.0.0",
    22.     "com.unity.analytics": "3.5.3",
    23.     "com.unity.burst": "1.4.7",
    24.     "com.unity.cinemachine": "2.7.3",
    25.     "com.unity.collections": "0.7.1-preview.3",
    26.     "com.unity.ext.nunit": "1.0.6",
    27.     "com.unity.ide.rider": "3.0.6",
    28.     "com.unity.ide.visualstudio": "2.0.7",
    29.     "com.unity.inputsystem": "1.0.2",
    30.     "com.unity.mathematics": "1.2.1",
    31.     "com.unity.mobile.android-logcat": "1.2.1",
    32.     "com.unity.performance.profile-analyzer": "1.0.3",
    33.     "com.unity.probuilder": "5.0.3",
    34.     "com.unity.recorder": "2.5.5",
    35.     "com.unity.textmeshpro": "3.0.3",
    36.     "com.unity.toolchain.macos-x86_64-linux-x86_64": "0.1.21-preview",
    37.     "com.unity.toolchain.win-x86_64-linux-x86_64": "0.1.19-preview",
    38.     "com.unity.ugui": "1.0.0",
    39.     "com.wetzold.travrsal.sdk": "file:../../com.wetzold.travrsal.sdk",
    40.     "games.artees.semver": "0.3.4",
    41.     "com.unity.modules.ai": "1.0.0",
    42.     "com.unity.modules.androidjni": "1.0.0",
    43.     "com.unity.modules.animation": "1.0.0",
    44.     "com.unity.modules.assetbundle": "1.0.0",
    45.     "com.unity.modules.audio": "1.0.0",
    46.     "com.unity.modules.cloth": "1.0.0",
    47.     "com.unity.modules.director": "1.0.0",
    48.     "com.unity.modules.imageconversion": "1.0.0",
    49.     "com.unity.modules.imgui": "1.0.0",
    50.     "com.unity.modules.jsonserialize": "1.0.0",
    51.     "com.unity.modules.particlesystem": "1.0.0",
    52.     "com.unity.modules.physics": "1.0.0",
    53.     "com.unity.modules.physics2d": "1.0.0",
    54.     "com.unity.modules.screencapture": "1.0.0",
    55.     "com.unity.modules.terrain": "1.0.0",
    56.     "com.unity.modules.terrainphysics": "1.0.0",
    57.     "com.unity.modules.tilemap": "1.0.0",
    58.     "com.unity.modules.ui": "1.0.0",
    59.     "com.unity.modules.uielements": "1.0.0",
    60.     "com.unity.modules.umbra": "1.0.0",
    61.     "com.unity.modules.unityanalytics": "1.0.0",
    62.     "com.unity.modules.unitywebrequest": "1.0.0",
    63.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    64.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    65.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    66.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    67.     "com.unity.modules.vehicles": "1.0.0",
    68.     "com.unity.modules.video": "1.0.0",
    69.     "com.unity.modules.vr": "1.0.0",
    70.     "com.unity.modules.wind": "1.0.0",
    71.     "com.unity.modules.xr": "1.0.0"
    72.   }
    73. }
    74.  
    And TMP is there with version 3.0.3

    upload_2021-5-12_13-31-21.png

    Again it would be helpful if you submit a bug with as much information as possible to try to solve this mystery.

    Cheers,

    Supi