To solve this problem in a proper way it s necessary to add a request for permission to the code. Access to storage is probably disabled. To fix this problem it is necessary to go to settings apps my app permission.