Android-Universal-Image-Loader
Android-Universal-Image-Loader copied to clipboard
java.lang.NullPointerException: StorageUtils.hasExternalStoragePermission
Hi, I received error logs from Google PlayStore report.
Do I need to check the permission
File cacheDir = StorageUtils.getCacheDirectory(sAppContext);
at this time?
Samsung Galaxy Note5(noblelte), 4096MB RAM, Android 7.0 version 1.9.5
java.lang.NullPointerException:
at com.nostra13.universalimageloader.utils.StorageUtils.hasExternalStoragePermission (StorageUtils.java:178)
at com.nostra13.universalimageloader.utils.StorageUtils.getCacheDirectory (StorageUtils.java:76)
at com.nostra13.universalimageloader.utils.StorageUtils.getCacheDirectory (StorageUtils.java:52)
at net.giosis.common.CommApplication.getUniversalImageLoader (CommApplication.java:203)
If you go through the code of method StorageUtils.getCacheDirectory
, you can actually see that cache directory will be created on sdcard and you need appropriate permissions. I am qouting from this StorageUtils.java
Cache directory will be created on SD card if card is mounted and app has appropriate permission. Else - * Android defines cache directory on device's file system..