Search Unity

Package Fails to Load in Unity 2020

Discussion in 'Package Manager' started by tatelax, Apr 28, 2021.

  1. tatelax

    tatelax

    Joined:
    Feb 4, 2010
    Posts:
    1,168
    Hi,

    I think I have discovered a bug in Unity 2020. My package works fine in Unity 2019. When I try to load my package in 2020 I get this error:

    Code (CSharp):
    1. [Package Manager Window] Cannot perform upm operation: Unable to add package [file:E:/LazyECS]:
    2.   The file [E:\LazyECS\package.json] is not valid JSON:
    3.     Unexpected token in JSON at position 0 [NotFound].
    4. UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    Here's my package.json

    Code (CSharp):
    1. {
    2.    "name":"com.kinematic.games.lazyecs",
    3.    "version":"1.1.1",
    4.    "displayName":"Lazy ECS",
    5.    "description":"This is an ECS package for lazy developers.",
    6.    "unity":"2017.1",
    7.    "unityRelease":"0b5",
    8.    "keywords":[
    9.       "ecs"
    10.    ],
    11.    "author":{
    12.       "name":"Tate McCormick",
    13.       "email":"tate@kinematic.games",
    14.       "url":"https://kinematic.games"
    15.    }
    16. }
    I was thinking maybe there's an invisible character floating around at the beginning of the file but it based on the tools I used, there is not. I also tried different line endings but that did nothing.
     
  2. tatelax

    tatelax

    Joined:
    Feb 4, 2010
    Posts:
    1,168
    Fixed it by changing encoding in Notepad++ to UTF-8