- Home /
Json errors on unity 2017 (working on 5.6)
Hello, I've got a working project that misteriously breaks till I've upgraded to unity 2017.
I've get this error, once I try to load a .json file based on a https server (the json file is correct as the error isn't triggered in Unity 5):
ERROR:
UnityEngine.Debug:Log(Object)
c__Iterator2:MoveNext() (at Assets/Scripts/OpenRequest.cs:56)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
and the related code that triggers it:
IEnumerator loadingTable(string createLink, string jsonFile){
check = false;
www = new WWW(createLink);
//Load the data and yield (wait) till it's ready
yield return www;
if (www.error == null)
{
//Sucessfully loaded the JSON string
check = true;
}
else
{
Debug.Log("ERROR: " + www.error);
}
}
Is there something changed in unity2017 about json (i'm using litJson library) ?
Anyone? So I guess the problem is not with unity2017 & json but elswere... but where?
Answer by MobizITS · Aug 11, 2017 at 10:21 AM
Change if www.error compare condition to if (!string.IsNullOrEmpty(www.error)) { it works
This returns the same error :/ ( well i mean this triggers as if it was empty too)
Follow this Question
Related Questions
How to constantly get new JSON information with GET request from a stream? Help!! 0 Answers
JsonUtility deserialization via JSON file doesn't work on WWW, works on File.ReadAllText 1 Answer
Accesing StreamingsAssets in android (LitJson) 1 Answer
json (LitJSON) from PHP array.. How? 0 Answers
Parse json/application with unity. 1 Answer