So after hearing the WWW now hits the native calls without TCP in .net being involved I upgraded to 1.6 in hopes it would speed things up.
Instead its now crashing the app entirely when the call is made. I also notice that the page which I had setup originally was inserting a record into a database at the server end on every hit, and now it was appearing to insert twice where as it wasn’t doing this before, almost as if the WWW class is double opening the URL? It is worth noting that the database page was being hit by the device and the insert was occurring (twice instead of once) before the app would crash the phone assumedly during the Response back from the web page.
Anyone know what is involved in rolling Unity back to 1.5.x? Is it as straight forward as installing the old version again over the top of 1.6?
To assist with the debugging, we made a brand new project which only called a WWW url (a static text file with 20 rows of text in it). The crash is still occurring. Empty scene with one guiText object to display the streamed text.
It is worth noting that the crash is only on device, all seems to work fine in editor.
— SAMPLE CODE ----
using UnityEngine;
using System.Collections;
public class TestWWW : MonoBehaviour {
public GUIText debugOutputText;
// Use this for initialization
void Start ()
{
StartCoroutine(LoadHighScores());
}
public IEnumerator LoadHighScores()
{
debugOutputText.text = “Loading test data.”;
WWW www = new WWW(“http://www.wildcardprosurfing.com/HIGH_SCORES.txt”);
yield return www;
if (www.error == null)
{
debugOutputText.text = www.data;
}
else
{
Debug.Log("ERROR: " + www.error);
}
www.Dispose();
www = null;
}
}
does it work if you cut the dispose line?
nope, didnt help. Good idea tho! As soon as you said it I thought it was on the money.
Alas the app opens up, and dies as soon as the request goes out with only the two lines of code in use.
WWW www = new WWW(“http://www.wildcardprosurfing.com/HIGH_SCORES.txt”);
yield return www;
And to make matters worse, I tried installing the 1.5.1 DMG over the top to roll back… It said it detected it was about to install an older version but it all went ok, however when I run the unity it still says its version 1.6 and it still crashes on this code…
Help much appreciated…
So it may be worth noting here, we were able to get the sample debug code to work by rolling back to 1.5.1 so its definately pointing towards a 1.6 bug.
FYI - to re-install 1.5 we simply renamed the Unity iPhone folder that was currently there, and installed 1.5.1 again fresh… This managed to do a complete downgrade…
and your project is building for .net 1.1 or 2.1?
Its really strange that it should break out of the nowhere as it now relies on iPhone OS own handling for that stuff … to cite a well known man: “D’OH!”
I tried both 1.1 and 2.1 .net versions when it was building with 1.6. I also removed the yield statement so it was polling the www.isDone property in the update loop just in case the yield was breaking it… it still crashed the app every time…
Also worth noting the double insert problem is still occurring with the rolled back code so that was likely user error and is not related to this bug. My suspicion is faulty button press code causing multiple www calls while the finger is still touching the screen. Simple enough fix.
Apparently I’ve got the same problem using WWW in 1.6. Although it doesn’t crash the app, it just hangs the WWW with zero progress. I know the code works because when I run it on the remote, the WWW downloads just fine. This worked perfectly in 1.5. Super annoying.
UPDATE:
So WWW.progress and WWW.isDone don’t work, but I took that code out and yielded the return of the WWW and it worked fine. It’s a shame though, because I had a nice download progress percentage counter. Anyone know how to get THAT to work with the new WWW protocol?
Hi,
I was not able to reproduce this issue. I tried with two iPhone’s and iPod. Write a bug report with a reproducible case and I will investigate this issue again. Thanks.
Andrius Kuznecovas
I was about to update from 1.5 to 1.6 but thankfully saw these posts and will now wait until the WWW protocol is ironed out as that is a feature I am currently developing with. Thanks for posting these and for your interest at finding a solution Andrius.
thanks
xian
For the record, my game which uses WWW upgraded from 1.5 to 1.6 with no issues. I wouldn’t think that it would make any difference, but I’m using JS rather than C#.
–Eric
I posted the code that was being used to replicate the issue. This is just in an empty scene with that script attached to the main camera and a GUIText parameter for displaying the output. I will leave the dummy high-scores file online so others can test with it.
ikeo wrote “but I took that code out and yielded the return of the WWW and it worked fine”
Can you possibly provide a sample of the code you are using? I will test on our environment to confirm if it does work or not and post back in here as a single-script project implementation if not.
I wonder if the bug is C# specific or not? JS appears to handle yields differently so perhaps that is related?