[Android] Unity5.3.2p3 can not load from SD-Card anymore > Unity4.x all is fine = what changed?

Hello,
i have a App in Stores made with Unity 4.x.
@ the start of the App i copy some files from Streaming Assets to Application.persistentDataPath…
works fine and i can access the files from my computer and for example change a file and Unity loads the file fine…
All went smooth no crash etc… everybody can access the file on sd-card …/storage/sdcard1/my-ID/files…

Now if i build with Unity 5.2.x i can not find my files anymore on SD-Card…
If i do a clean install on my Android i can not find the folder com.xxx.Xx/files/…
Also Application.persistentDataPath gives now a different path… like data/data/emulatedStorage0/etc…

Sry but what did i miss in the change from 4 to 5 ???
Something fundamental changed and WHY?

Since the last week i try to read a file from SD-Card on Android… with Unity 4.x no Problem with Unity 5.x i can’t get it to work…
Is this a bug?
How do i access a file that is on the root of a SD-Card ?
here is a code to find the right sd-card name… but if i have the path Unity don’t want to load something from SD-Card…

public string GetExternalFilePath(){
        if (Directory.Exists("/storage/extSdCard")) return "/storage/extSdCard";
        if (Directory.Exists("/storage/sdcard1")) return "/storage/sdcard1";
        if (Directory.Exists("/storage/usbcard1")) return "storage/usbcard1";
        if (Directory.Exists("/storage/sdcard0")) return "/storage/sdcard0";
      return Application.persistentDataPath;
    }

Example:
file:///storage/sdcard1/image.png doesn’t work… path is fine but Unity is not able to load…

can anyone bring a bit light in? Should i go with Unity4 like many other do?
Also lot’s of devices are dropped with Unity 5.x… don’t understand why
Will Android development dropped sometime soon in Unity 5 ??? Like Blackberry and Windows Phone 8 etc…
btw. not lot activity around Android here… why?

hope someone can help… !
many thx for taking the time…
M.

P.S. did not change my Manifest or anything…
So i have setup in Player:
Install Location: prefer external
Write access: External SD-Card

and in Mainfex i have this:


here this is how it looks with Unity 5.x.x no files to see!

1 Like

Unity 4 to Unity 5 is a major version upgrade. Many things have dramatically changed.

A valid recommendation based on your post is to avoid using direct file system access. This is not a recommended practice for any mobile platforms, as far as I know.

We are using Android APIs to get path for the pesistent dir. Something may have changed with regard to the paths, but I can’t remember for sure. If you need to check the files you are saving to persistent dir - root your phone and get all the access you need.

Hello Yury,
many thx for the reply!
Well the problem is that my app need this UIFileSharing like i use on iOS.
The user can easy change assets etc…
With Android it was also possible in Unity3d v.2.x to 4.x like i have shown above.
Now there is no chance for a similar feature on Android?
Also if i try to get a file from the sd-card i get this access denied… in Unity 5.x not in Unity 4.x…
Should i do a bug report?
thx
M.

Hi!

Yes please - if you could submit a bug report with a small project showing your concerns (don’t forget to mention what you are trying to implement), that would help find out a solution.

Thanks!
Yury