java.io.IOException: No space left on device Android

眉间皱痕 提交于 2021-02-07 12:34:42

问题


We have application on android market, our users getting a lot from this error: java.io.IOException: No space left on device

From what I found out so far, I know that they got enough space left on they external storage, and it's only happen on Android 2.x .

I had a small research in Linux file system, and I found out that beyond the space limitation there are limitation on number of files in each directory and the total number of files under root directory. But it looks like our app is not hitting any of those.

  • Have you ever run in two some thing like that?
  • Any ideas about what changed in Android (2.x) and how they fix it in Android (3+)?

Edit: this is not installation problem, but when trying to save downloaded files.


回答1:


adding a loging-output of the absolute filepath, that caused the exception might help.

if the file beeing written was written to local memory file-system and not to sd-card-filesystem here is a possible solution:

java.io.IOException: No space left on device my mean that there is not enought memory left on the internal storage file system of the device.

You can try to install the app on the sd-card instead by setting an entry in the manifest-file:

  <manifest ..... android:installLocation="preferExternal">

Edit

if an app is installed in internal memory it-s local files are stored in local memory, too. if an app is installed on sd-cardit it-s local files are stored on sd-card, too.

so installing the app on sd-card might solve your problem.




回答2:


I believe (if I'm not correct) that it could be having trouble opening a big file or any file that goes over the max of the eternal storage after all the space is used up. For example: My android didn't have any problems opening up until after I used all of the space on my device til the very last bit. Unless I upgrade or delete all of my fav songs and movies it won't work. Tested and tried it. But then again the error could be more flexible and mean something else as well... :D



来源:https://stackoverflow.com/questions/10469207/java-io-ioexception-no-space-left-on-device-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!