Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid External Storage Path #24

Open
rayliverified opened this issue Sep 22, 2019 · 2 comments
Open

Invalid External Storage Path #24

rayliverified opened this issue Sep 22, 2019 · 2 comments
Assignees
Labels

Comments

@rayliverified
Copy link

I got the following crash from an user on a Samsung Galaxy Tab 2 (Android 9.0)

Fatal Exception: java.lang.IllegalArgumentException
Invalid path: /storage/emulated/0
android.os.StatFs.doStat (StatFs.java:51)
android.os.StatFs.<init> (StatFs.java:41)
github.nisrulz.easydeviceinfo.base.EasyMemoryMod.getAvailableExternalMemorySize (EasyMemoryMod.java:147)
Caused by android.system.ErrnoException
statvfs failed: ENOENT (No such file or directory)
libcore.io.Linux.statvfs (Linux.java)
libcore.io.BlockGuardOs.statvfs (BlockGuardOs.java:333)
android.system.Os.statvfs (Os.java:570)
android.os.StatFs.doStat (StatFs.java:49)
android.os.StatFs.<init> (StatFs.java:41)
github.nisrulz.easydeviceinfo.base.EasyMemoryMod.getAvailableExternalMemorySize (EasyMemoryMod.java:147)

A quick StackOverflow search shows me that the reason it crashes is because you can't assume that an external storage exists.

Currently wrapping getAvailableExternalMemorySize() in a try catch to prevent crash.

@rayliverified
Copy link
Author

Thanks for creating this library, it's fantastic :)

@nisrulz
Copy link
Owner

nisrulz commented Sep 23, 2019

Good catch. I will add that and more fixes related to this soon.

Thank you for reporting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants