Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

External Storage no longer available to Apps

$
0
0

Has there been a change to VS2017 recently that would disable access to external storage?
I have an app that I have been working on for awhile. Today, when I tried to run it, images (which are stored on the external SD card) did not appear.
I make backups of my projects every couple days. (for easy recovery if I break something) I loaded the version from 9/16 (ten days ago) that worked fine when I archived it. It, likewise, no longer shows images from the external storage.
When the program runs, I get the following Output:

09-26 17:05:17.334 E/BitmapFactory( 5301): Unable to decode stream: java.io.FileNotFoundException: /storage/6438-111A/ExploreStars/Images/dp180/Messier/M009.png (Permission denied)

I checked the path using X-plore and AndroXplorer. The images are still there, in the same location as before. My Manifest has not changed, READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE are still set. No error messages are generated when it runs.

Did something change with the recent update to VS2017? Are there new requirements for accessing external storage? I checked the attributes using a card reader on my PC and then appeared normal. Has anyone else seen this behavior? Is there a way to restore the previous version of VS2017?

Here is the code that accesses the images. I haven't changed it in awhile.

    public static class ImageAssetManager
    {
        public static Dictionary<string, Drawable> cache = new Dictionary<string, Drawable>();

        public static Drawable Get(string url)
        {
            string imageurl;

            imageurl = Vars.DataLoc + "ExploreStars/Images/" + url;

            if (!cache.ContainsKey(imageurl))
            {
                Drawable drawable;
                drawable = Drawable.CreateFromPath(imageurl);
                cache.Add(imageurl, drawable);
            }

            return cache[imageurl];
        }

    }

Thanks for your help,
Dan


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>