As shown in the title, when I called the method getExternalFilesDir(null)
, i got a warning like this:
Failed to ensure directory: /storage/emulated/0/Android/data/com.xxxx.app/files
So, it turns out that the i cannot get the path /storage/emulated/0/Android/data/com.xxxx.app/files
Also, the problem only happens sometimes.
This happened to me when uninstalling the app and reinstalling it. But probably the resources of the app (com.xxxx.app in your case) had a reference not released.
The solution was quite simple: just stop and relaunch the emulator, or reboot the phone should do the trick.