Error in load texture from android gallery to unity3d

329 Views Asked by At

I have a problem with loading texture from android gallery , I wrote a plugin and could open gallery and got path picture and then I used it in this function :

 IEnumerator Wait()
{
 www = new WWW("file://"+filePathTemp);
 yield return www;
 if (www.error != null)
 {
  Debug.Log("ERROR " + www.error);
 }else
 {
  Debug.Log(www.texture);
 }
} 

my path from android is: /storage/emulated/0/DCIM/Camera/۲۰۱۵۰۱۰۱_۰۳۴۸۴۱.jpg and full path is : file:///storage/emulated/0/DCIM/Camera/۲۰۱۵۰۱۰۱_۰۳۴۸۴۱.jpg

I tried file:/ or file:/// too but it got this error: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.read(byte[])' on a null object reference

how can I fix this error and load my picture? is my problem in my path or loading picture ( my plugin works fine) sorry for my weak English

0

There are 0 best solutions below