Problem with persistentDataPath on Android

Having a devil of a time with saving files on Android. I Debug.Log where it thinks it will save:

Debug.Log (“Saving to:”+Application.persistentDataPath+”/myfile.png”);
Application.CaptureScreenshot (Application.persistentDataPath+"/myfile.png");

and it fail to save it, my log says:

Saving to:/data/data/com.mycomp.myapp/files/myfile.png

then

Failed to open file at path: /data/data/com.mycomp.myapp/data/data/com.mycomp.myapp/files/myfile.png

which is REALLY messed up.
Clearly I should remove the persistentpath from the CaptureScreenshot call, but /data/data? Where’s that?

I have set project player settings to use external file.

This happens on a Droid4 (Android 2.3.6). On Xoom (Android 4.0.4) it saves to mnt/sdcard/com.mycomp.myapp/files/myfile.png just fine.

What’s going on?

The problem is that you are appending the file name to the persistent data path. This is already done by Application.CaptureScreenshot on mobile platforms, as stated in the documentation.