JSON Parse error: Unrecognized token < parse@[native code] after attempt to login in Make It Native app

0
Today logging into our native app dows not work locally anymore with the Make It Native app. After entering username and password and those are processed in a nanoflow with a “Sign in” action, the mobile app shows (in Dutch): “Uw wijzigingen kunnen niet worden gesynchroniseerd (...)” and logging shows: JSON Parse error: Unrecognized token '<' parse@[native code] Does anyone recognize this? It has worked before, until today.  
asked
4 answers
1

Yep. The call expects a JSON in the body of the response in of the request, as it usually does, but now something has gone wrong and instead of JSON an XML is received. Mendix accepts that as far as upto the JSON-import mapping, which brakes at the first unexpected character, being the ‘<’ that any xml starts with.

The difficulty here is to get to the code that does the call. That is the native login code. Probably you can’t get to it yourself and Mendix should help as it is their code.   

 

answered
0

The problem disappeared after one night. Maybe VPN was blocking the connection.

answered
0

In case anyone else finds this post, I have just hit the same error.  I am running on Mx Studio Pro 9.5.0. 

When I logged in using Make It Native 9 it failed.  In developer mode I could see that I was getting the same error message as described above.  I set the log level in the console to debug for JSON and I could see the downloads relating to the sync of the user’s data.  In my case there were some missing files relating to image objects.  This may have been the source of the problem or it may not.  

I tried rebooting every part of the set up and that didn’t help. 

I then logged in to the app as another user with no personal data and that worked without the error.

So I logged into the desktop as the first user and deleted all that data and when I logged into the app again it worked.

So it really looks like it’s something to do with syncing the data to the device.

answered
0

For reference: The same error occured to me whenever the backend Mendix App was down and the App tried to sync.

It seems to me that there is some kind of html error message returned that is not parsable by the native Apps JSON parser.

I would expect the native App to detect somehow that the server is not reachable and return a "Server not reachable" error message instead.

answered