easydeviceinfo
easydeviceinfo copied to clipboard
Invalid External Storage Path
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.
Thanks for creating this library, it's fantastic :)
Good catch. I will add that and more fixes related to this soon.
Thank you for reporting this issue.