- Home /
Updating app cannot load downloaded image
I am downloading images to use as sprites and storing the path and filename used as PlayerPrefs. I also store the id of the image file and that is has already been downloaded. This path and name is then used to load the image.
However if the app is updated by overwriting the existing app I get the red question mark image, indicating there is a problem.
I am doing a check to see if the file exists - it does. The number of bytes downloaded is zero and the width and height of the Texture is 8, the red question error image size.
I do not know why the app does not load the images when the app has been updated by overwriting the app but works fine on a new install.
Any help would be greatly appreciated - I've been stuck on this for a while now!
NOTE: here is the code used for loading the sprite. It is in a coroutine example path passed in /var/mobile/Containers/Data/Application/FEADD525-A7AC-4F46-8412-5241358BB193/Documents//11319C3D4A1ABB912EB35FEA1AF483E9/thumb_foreground.png
path = "file://" + path;
Debug.Log("path[" + path+"]"); FileInfo info = new FileInfo(path);
WWW www = new WWW(path); yield return www.isDone; bytesDownloaded["+www.bytesDownloaded+"]");
Texture2D texture = new Texture2D(1, 1, TextureFormat.ARGB32, false); www.LoadImageIntoTexture (texture); Sprite sprite = Sprite.Create(texture as Texture2D, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
www.Dispose(); www = null;
Also I have double checked on the actual device and the images are in the path being used