Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSteven Buchko
4,387 PointsProblem accessing external storage device
I keep receiving the Toast that tells me I am unable to access my external storage device when I try to take a picture using a Galaxy S5 for the app. I ran the debug code and got the following result (I followed along with all of the videos):
11-10 22:44:53.509 6294-6294/com.stevenbuchko.ribbit2 D/MainActivity﹕ >> Let's debug why this directory isn't being created: 11-10 22:44:53.509 6294-6294/com.stevenbuchko.ribbit2 D/MainActivity﹕ Is it working?: false 11-10 22:44:53.509 6294-6294/com.stevenbuchko.ribbit2 D/MainActivity﹕ Is it available?: true 11-10 22:44:53.509 6294-6294/com.stevenbuchko.ribbit2 D/MainActivity﹕ Does it exist?: false 11-10 22:44:53.519 6294-6294/com.stevenbuchko.ribbit2 D/MainActivity﹕ What is the full URI?: file:/storage/emulated/0/Pictures/Ribbit2 11-10 22:44:53.519 6294-6294/com.stevenbuchko.ribbit2 D/MainActivity﹕ -- 11-10 22:44:53.519 6294-6294/com.stevenbuchko.ribbit2 D/MainActivity﹕ Can we write to this file?: false 11-10 22:44:53.519 6294-6294/com.stevenbuchko.ribbit2 D/MainActivity﹕ >> We can't write! Do we have WRITE_EXTERNAL_STORAGE permission? 11-10 22:44:53.519 6294-6294/com.stevenbuchko.ribbit2 D/MainActivity﹕ >> We don't have permission to write - please add it. 11-10 22:44:53.519 6294-6294/com.stevenbuchko.ribbit2 D/MainActivity﹕ Are we even allowed to read this file?: false 11-10 22:44:53.519 6294-6294/com.stevenbuchko.ribbit2 D/MainActivity﹕ -- 11-10 22:44:53.519 6294-6294/com.stevenbuchko.ribbit2 D/MainActivity﹕ >> End of debugging.
I have added the permission in the Manifest, so I am confused as to why it is saying False.
The permission: <uses-permission android:name="ANDROID.PERMISSION.WRITE_EXTERNAL_STORAGE" />
Thank you for the help! Please let me know if there is any other code you would like to see.
Ben Deitch
Treehouse TeacherIf you run it on a current (API 23) virtual device do you get the same error?
Niyamat Almass
8,176 PointsI have the same problem.
But solved.
Here is the link
https://teamtreehouse.com/community/there-was-a-problem-accessing-your-devices-external-storage
1 Answer
Steven Buchko
4,387 PointsIt looks like I needed to add the additional permissions because my phone is running on the latest API. Thanks guys!
Steven Buchko
4,387 PointsSteven Buchko
4,387 PointsThe formatting of my question got all messed up when I posted, so please let me know if you need me to explain anything further