When writing files to sdcard. Error reported: Android reports java. Io. ioexception: Permission denied First, check whether your path is correct. You should write something in the directory environment. getexternalstoragedirectory. If the path is correct, check whether the permission is added to your application. </> If not, add <uses-Permission Android: Name = "android. Permission. write_external_storage"/> If all of the above are correct, but the above errors are still met. Check whether your AVD has set the size when it is created. If it is not set, create a new AVD with the size. The above is a classic answer I found on the Internet. I did the first two, but I still report an error. The third item was not tested because I directly connected the mobile phone to the computer for debugging. This is exactly the problem !!! We all know that when a mobile phone is connected to a computer with a USB cable, access to the data on the SD card is forbidden, So you run yourProgram, Of course, you do not have the permission to read and write the SD card, and naturally cannot perform Io operations. Alas, after finding the problem, I feel very embarrassed, but we are constantly growing up in the second year of committing crimes. Come on! |