I am working on a big project right now so what i am doing is converting the .exe application to .apk application and fortunately i successfully converted it somehow there’s an error:
The whole error:
NullReferenceException: Object reference not set to an instance of an object at LitJson.JsonMapper.ToObject[ServerListJson] (System.String json) [0x00000] in :0 at LogoUI+c__Iterator2.MoveNext () [0x00000] in :0 at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in :0
So I’m suspecting that the error above is in the logoUI.cs only.
Am i calling it wrong. Can someone point out whats wrong on what i am doing.
LogoUI.cs
void TryShowIntro()
{
StartCoroutine(“CheckVersion”);
}
IEnumerator CheckVersion()
{
lbl_notification.text = NOTIFICATION[0];
yield return new WaitUntil(() => tzGlobal.Instance.VERSION != null);
FadeInVersion(tzGlobal.Instance.VERSION);
StartCoroutine(“CheckServer”);
}
IEnumerator CheckServer()
{
lbl_notification.text = NOTIFICATION[1];
// Load the URL.
CheckJSonManager.Instance._AwsDatacenterURL.SetURL();
// Download the notice.
WWW www = new WWW(CheckJSonManager.Instance._AwsDatacenterURL.NOTICE_URL);
yield return www;
// Save notice.
StreetUtility.SaveJson_mk2(www.text, string.Format(“{0}/notice.json”, Application.streamingAssetsPath));
// Download server list.
www = new WWW(CheckJSonManager.Instance._AwsDatacenterURL.SERVERLIST_URL);
yield return www;
// Store server list.
CheckJSonManager.Instance._ServerListJSon = LitJson.JsonMapper.ToObject(www.text);![]()
// Server information to be connected is stored separately.
bool bFound = false;
ServerListJson pServerListJSon = CheckJSonManager.Instance._ServerListJSon;
int target_server_no = System.Int32.Parse(tzGlobal.Instance.VERSION.Split(‘.’)[2]);
for (int i = 0; i < pServerListJSon.serverData.Length; i++)
{
if (target_server_no == pServerListJSon.serverData*.serverNo)
__{__
bFound = true;
_ServerData pServerList = pServerListJSon.serverData;
NetworkManager.Instance.WebSocketServer.SESSION_NAME = pServerList.serverNo.ToString();
NetworkManager.Instance.WebSocketServer.SESSION_IP = pServerList.serverIP;
NetworkManager.Instance.WebSocketServer.SESSION_PORT = pServerList.serverPort;
tzGlobal.Instance.LOGIN_URL = pServerList.publisherURL;
tzGlobal.Instance.JOIN_URL = pServerList.joinURL;
tzGlobal.Instance.STREAMING_URL = pServerList.streamingURL;
break;
}
}
if (!bFound)
{_
// Debug.LogWarning(“ServerList_mk2.json does not find the required server number. Use the first server information.”);
Debug.LogWarning(“pc_version / ph / check / serverList.json does not find the required server number. Use the first server information.”);
ServerData pServerList = pServerListJSon.serverData[0];
NetworkManager.Instance.WebSocketServer.SESSION_NAME = pServerList.serverNo.ToString();
NetworkManager.Instance.WebSocketServer.SESSION_IP = pServerList.serverIP;
NetworkManager.Instance.WebSocketServer.SESSION_PORT = pServerList.serverPort;
tzGlobal.Instance.LOGIN_URL = pServerList.publisherURL;
tzGlobal.Instance.JOIN_URL = pServerList.joinURL;
tzGlobal.Instance.STREAMING_URL = pServerList.streamingURL;
_}
// Auto-connect after a while.
StartCoroutine(“GoToLoginSceneAutomatically”);
EnableSkip(“auto”);
}_
What i tried so far is this.
1.) I print out.
- Debug.Log("www notice url= " + CheckJsonManager.Instance.AwsDatacenterURL.NOTICE_URL);
Output
jar:file:///data/app/com.steet383.rh.google-1/base.apk!/assets/notice.json
- Debug.Log("www serverlist url= " + CheckJSonManager.Instance.AwsDatacenterURL.SERVERLIST_URL);*
Output
jar:file:///data/app/com.steet383.rh.google-1/base.apk!/assets/serverList.json
Now this line of code
// Save the server list.
CheckJSonManager.Instance._ServerListJSon = LitJson.JsonMapper.ToObject(www.text);![]()
I guess because i put a debug.log and it doesn’t proceed to that line anymore.
It works on UNITY_STANDALONE but when i tried to change the platform to UNITY_ANDROIDthis line gives me the error. Is this code
CheckJSonManager.Instance._ServerListJSon = LitJson.JsonMapper.ToObject(www.text);![]()
not suitable for android??
Thank you in advance guys.