Is there any way to fix this: Expected name at line 45 column 7 path $.client[0].services

Francis :

Got this error code when trying to build on android studio.

Expected name at line 45 column 7 path $.client[0].services

Where is the error located. Kindly assist with this

Below attached is my google-services.json file. If that might help

 {
   "project_info": {
     ...
   },
   "client": [
     {
         "client_info": {
           ...
         },
         "oauth_client": [
           ...
         ],
         "api_key": [
           ...
         ],
         "services": {
           ...
         },
       {                      
         "client_info": {
           ...
         },
Andreas :

As the error message says, the error is at line 45 column 7

 1: {
 2:   "project_info": {
...     ...
 7:   },
 8:   "client": [
 9:     {
10:         "client_info": {
...           ...
15:         },
16:         "oauth_client": [
...           ...
29:         ],
30:         "api_key": [
...           ...
34:         ],
35:         "services": {
...           ...
44:         },
45:       {                      <== error is here
46:         "client_info": {
...           ...
51:         },

The indentations are a bit inconsistent, but since line 46 looks like a second instance of line 10, I believe the problem is that the services property is supposed to be the last property of that client object, so the , should have been a }, on a line by itself.

35:         "services": {
...           ...
44:         }
new       },
45:       {
46:         "client_info": {

That ends the object started on line 9, and line 45 then starts a second object for the array started in line 8.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=396744&siteId=1