反序列化 Google-services.json 文件时出错
Error deserializing Google-services.json file
尝试按照说明通过 MS 应用中心设置推送通知。所以我按照说明在 Firebase 控制台中创建了一个应用程序,然后从那里下载了 google-services.json 文件。将其复制到我的项目并将构建操作固定为 GoogleServicesJson。在 Firebase、App Center 和我的代码中完成其余设置。但是当我尝试构建时,出现以下错误 - There was an error deserializing the object of type Xamarin.GooglePlayServices.Tasks.GoogleServices
.
堆栈跟踪给了我这个信息:
There was an error deserializing the object of type Xamarin.GooglePlayServices.Tasks.GoogleServices. Encountered an unexpected character 'ï' in JSON. ---> System.Xml.XmlException: Encountered an unexpected character 'ï' in JSON.
但我在文件中的任何地方都看不到 ï。搜索了这个问题,发现人们使用解析器来解决这个问题,但我不确定在哪里应用所述解析器。
有人遇到过这种情况吗?
文件如下所示
{
"project_info": {
.. Configuration info ..
},
"client": [
{
.. Lots of lines ..
}
],
"configuration_version": "1"
}
所以,我右键单击 Visual Studio 中的文件,然后选择 "Hex Editor"。
瞧,ï
是文件的第一个字符,在左大括号之前还有 >>
和 ?
:{
所以我删除了左大括号之前的多余字符,错误就解决了。现在转到其他错误...
尝试按照说明通过 MS 应用中心设置推送通知。所以我按照说明在 Firebase 控制台中创建了一个应用程序,然后从那里下载了 google-services.json 文件。将其复制到我的项目并将构建操作固定为 GoogleServicesJson。在 Firebase、App Center 和我的代码中完成其余设置。但是当我尝试构建时,出现以下错误 - There was an error deserializing the object of type Xamarin.GooglePlayServices.Tasks.GoogleServices
.
堆栈跟踪给了我这个信息:
There was an error deserializing the object of type Xamarin.GooglePlayServices.Tasks.GoogleServices. Encountered an unexpected character 'ï' in JSON. ---> System.Xml.XmlException: Encountered an unexpected character 'ï' in JSON.
但我在文件中的任何地方都看不到 ï。搜索了这个问题,发现人们使用解析器来解决这个问题,但我不确定在哪里应用所述解析器。 有人遇到过这种情况吗?
文件如下所示
{
"project_info": {
.. Configuration info ..
},
"client": [
{
.. Lots of lines ..
}
],
"configuration_version": "1"
}
所以,我右键单击 Visual Studio 中的文件,然后选择 "Hex Editor"。
瞧,ï
是文件的第一个字符,在左大括号之前还有 >>
和 ?
:{
所以我删除了左大括号之前的多余字符,错误就解决了。现在转到其他错误...