Through Crashlytics I get the following error from one of my apps
I understand that the problem (End of input at character 0 of) occurs because the JSON file was not created correctly, this JSON I generate with this event
Should I use a Try...Catch before ending B4XPage_Background or the problem is another
Crashlytics:
JSONParser.java line 48
anywheresoftware.b4a.objects.collections.JSONParser.NextObject
Fatal Exception: org.json.JSONException
End of input at character 0 of
Code:
Dim parser As JSONParser
parser.Initialize(FileText)
Dim Map1 As Map = parser.NextObject '<-- Error in this line according to Crashlytics
I understand that the problem (End of input at character 0 of) occurs because the JSON file was not created correctly, this JSON I generate with this event
B4XMainPage:
Sub B4XPage_Background
...
Private JSONGenerator As JSONGenerator
JSONGenerator.Initialize(MapaDatos)
JS = JSONGenerator.ToPrettyString(2)
File.WriteString(Path, FileText, JS)
End Sub
Should I use a Try...Catch before ending B4XPage_Background or the problem is another