Cache directory doesn't exist

how is it possible that context.getApplicationContext().getCacheDir() returns null? As far as I know the internal cache directory should always exist.

Thanks!

  • Android: correct way of jumping between fragments
  • Android get only image from gallery
  • Android Button needs two click for action
  • Date picker in Android
  • Handle Paging with RxJava
  • “LayoutManager is already attached to a RecyclerView” error
  • Android Layout: Horizontal Recyclerview inside a Vertical Recyclerview inside a Viewpager with Scroll Behaviors
  • looking to implement a wall (GridView?) that goes off-screen and user can touch to move it around
  • Android Server Socket
  • Views above and below RecyclerView
  • Appcompat / add a library with android studio
  • how to design right to left linear layout
  • 2 Solutions collect form web for “Cache directory doesn't exist”

    maybe it returns null since you don’t have enough internal storage? try to also use getExternalCacheDir

    also , if it doesn’t work , simply go to the path.

    the standard is that it should give you the path “/data/data/YOUR_APP_PACKAGE_NAME/cache/” , and if you want the external storage cache , it should give you the path “EXTERNAL_STORAGE_PATH/Android/data/YOUR_APP_PACKAGE_NAME/cache/” .

    Reading the thread posted at http://goo.gl/zipcZ it appears that an uninstall and re-install of the application resolves the issue in many cases. Additionally reading the thread, it does not appear that this is something you can fix as its an internal issue on some devices.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.