As i already mentioned in the Title, i recognized some strange problems when i uninstall my App from the GooglePlayStore and reeinstall it. As you can see the App Cache Directory is not deleted, the App is called net.example :
shell@gt510wifi:/storage/emulated/0/Android/data $ ls -la
-rw-rw---- root sdcard_rw 0 2015-01-01 01:01 .nomedia
...
drwxrwx--x u0_a80 sdcard_rw 2017-01-27 09:30 flipboard.boxer.app
drwxrwx--x u0_a197 sdcard_rw 2017-03-01 17:47 net.example
drwxrwx--x root sdcard_rw 2016-12-29 14:00 shaders
app is uninstalled, but cache and data directory persist:
shell@gt510wifi:/storage/emulated/0/Android/data $ ls -la
-rw-rw---- root sdcard_rw 0 2015-01-01 01:01 .nomedia
...
drwxrwx--x u0_a80 sdcard_rw 2017-01-27 09:30 flipboard.boxer.app
drwxrwx--x u0_a197 sdcard_rw 2017-03-01 17:47 net.example
drwxrwx--x root sdcard_rw 2016-12-29 14:00 shaders
shell@gt510wifi:/storage/emulated/0/Android/data $
From the Documentation:
Note: When the user uninstalls your application, this directory and all its contents are deleted. Also, the system media scanner does not read files in these directories, so they are not accessible from the MediaStore content provider. As such, you should not use these directories for media that ultimately belongs to the user, such as photos captured or edited with your app, or music the user has purchased with your app—those files should be saved in the public directories.
https://developer.android.com/guide/topics/data/data-storage.html#filesExternal
So it seems to be a Samsung Bug which leads to Permission Errors after the App is reeinstalled:
E/BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/Android/data/net.example/cache/FileCache/20b7a74246f5d80d92ba2e3d1918331cfb98fd11: open failed: EACCES (Permission denied)
Maybe someone experienced a similiar Bug on a Samsung Device?
EDIT: I already implemented the "allowBackup:false"
in the Manifest, but the problem still occurs.