- Home /
WWE Error: java.lang.NullPointerException
i have a local server, and i try to connect to it using WWW class, like this:
public void POST (LoginData loginData)
{
WWWForm form = new WWWForm ();
string serializedData = Serialize (loginData);
form.AddField ("login_data", serializedData);
WWW www = new WWW (URL, form);
StartCoroutine (MakeUserWaitForRequest (www));
}
IEnumerator MakeUserWaitForRequest (WWW www)
{
yield return www;
// check for errors
if (www.error == null) {
Debug.Log ("WWW Ok!: " + www.text);
user = Deserialize<User> (www.text);
} else {
Debug.Log ("WWW Error: " + www.error);
}
}
in UnityPlayer it works fine, but on my device i get this debug log:
I/Unity(12796): WWW Error: java.lang.NullPointerException
I/Unity(12796): UnityEngine.Debug:Internal_Log(Int32, String, Object)
I/Unity(12796): UnityEngine.Debug:Log(Object)
I/Unity(12796): <MakeUserWaitForRequest>c__Iterator4:MoveNext() (at C:\PATH\UserManager.cs:42)
I/Unity(12796):
I/Unity(12796): (Filename: C Line: 0)
line 42 in UserManager.cs is Debug.Log ("WWW Error: " + www.error); I have permissions for internet, i can access my server from browser. Any help?
Comment
Your answer
Follow this Question
Related Questions
"Absolute URI is too short" woe 1 Answer
GetThreadContext failed during runtime (not in editor) 0 Answers
What kind of error handling does the WWW class have? 1 Answer
@ makes problem in ios 1 Answer