VictorAlbertos / RxSocialConnect-Android

OAuth RxJava extension for Android.
Apache License 2.0
257 stars 22 forks source link

Unnable to create session file after closing connections #19

Closed miguelbcr closed 7 years ago

miguelbcr commented 7 years ago

I get this error when I try to login after calling RxSocialConnect.closeConnections() :

java.io.FileNotFoundException: /data/user/0/com.my.app/files/RxSocialConnect/FacebookApi: open failed: ENOENT (No such file or directory) on Disk.java

I've been debuging and these are my conclusions;

So, as a possible solution, you could call cacheDirectory.mkdirs(); before the file creation

What do you think? Thanks!

VictorAlbertos commented 7 years ago

Thanks @miguelbcr ;)

Your solution sounds good to me. I'll try to fix it this weekend, but a PR is also welcome :P

miguelbcr commented 7 years ago

Hi @VictorAlbertos , I've been debuging again and the error is not related with your lib, sorry, my app deletes all files under files private dir at the same time RxSocialConnect.closeConnections()is called in order to delete all files related with the current user session.

Anyway it would be good to add cacheDirectory.mkdirs(); in order to ensure that RxSocialConnect folder exists before creating the file as a defensive technique. If not, I could force to create RxSocialConnect folder.

Thanks!