Search Unity

Failed to resolve packages

Discussion in 'Package Manager' started by Hyp-X, Dec 11, 2018.

  1. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    438
    Code (CSharp):
    1. Failed to resolve packages: The file [E:\Work\<project-name>\Packages\manifest.json] is not valid JSON:
    2.   Unexpected token '' at 1:1
    3.   {
    4.   ^. No packages loaded.
    Happens every time after merging the .json file with p4merge.
    Caused by p4merge inserting a BOM at the start of the file (not shown in the error message).

    Please use a parser that doesn't choke on BOM.
    (Tested with latest versions of 2018.2, 2018.3, 2019.1)
     
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hi @Hyp-X,

    I've done a quick scan on the internet and it seems BOM issues are common with p4merge. Can you check your p4merge or perforce configuration? As what it worth, this Stack Overflow answer makes me believe it will be hard to find a JSON parser that supports BOM character since this is not required by the spec: https://stackoverflow.com/a/38038099/449712

    Regards,

    Pascal
     
    Last edited: Dec 11, 2018
  3. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    438