I’m getting an authorization error on the following code on an iphone5 but not an iphone 4s when trying to write an assetbundle to the streamingassets path. I’ve tried deleting the app and restarting the phone but still it crashes with the error below. Is this a unity problem or some phone setting issue? or something to do with the bytes not arriving?
url=http://somepass:somelogin@www.website.com/hat2_tophat.unity3d;
var www = new WWW(url);
yield www;
var filepath= Application.streamingAssetsPath + "/"+prop.name+".unity3d";
Debug.Log("filepath="+filepath);
File.WriteAllBytes(filepath, www.bytes);
Unhandled Exception: System.UnauthorizedAccessException: Access to the path "/var/mobile/Applications/32CBA0EC-F1A9-428D-8B90-5B8FE8D156AC/improvapp.app/Data/Raw/hat2_tophat.unity3d" is denied.
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) [0x00000] in <filename unknown>:0
at System.IO.File.Create (System.String path, Int32 bufferSize) [0x00000] in <filename unknown>:0
at System.IO.File.Create (System.String path) [0x00000] in <filename unknown>:0
at System.IO.File.WriteAllBytes (System.String path, System.Byte[] bytes) [0x00000] in <filename unknown>:0
at world17dabear_nodebugs+$loadObject$954+$.MoveNext () [0x00000] in <filename unknown>:0