- Home /
Error on package.json: Unexpected token " at 1:1
I'm trying to add a package in the new Unity Package Manager. I modified my manifest.json to target a local package. I created a new package.json :
{
"name": "com.enthropia.modalmanager",
"displayName": "Modal Manager",
"version": "1.0.0",
"unity": "2018.1",
"description": "A simple modal manager which open modals with fade in background. \n- To improve runtime calculations modals are intantiated only on first time call\n- Only one modal can be open in the same time\n- Overridable Build method can help you to inject datas in modal\n- Can be easily used with UIController",
"keywords": [
"modal",
"manager",
"enthropia"
],
"category": "Managers"
}
The file is found but Unity send me this error:
Error with package details: The file [[MyPath]\ModalManager\package.json] is not valid JSON: Unexpected token '' at 1:1 { ^ UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Any idea?
Answer by Deng-Jia · May 06, 2020 at 10:32 AM
package.json need be saved as UTF-8 without BOM
Yep, that would be my first guess when that error happens. Since it complains about the line / column 1:1 it has to be the first character. So in almost all cases it's the invisible byte order mark that is added depending on the encoding of the text.
Open with notepad-> save as -> utf-8 (not utf-8 BOM)
Your answer
Follow this Question
Related Questions
Unity Package Manager Error 0 Answers
[Solution] Cinemachine installation with Package Manager error 0 Answers
NuGet Package not working (Algorand) 1 Answer
Package manager not showing 0 Answers