You need to sign in to do that
Don't have an account?
Android re-login fails after logging out with API call
In my hybrid Android app built with the Salesforce SDK, quite often (but not always), a subsequent login after the app logs out using the API -- var sfOAuthPlugin = cordova.require("salesforce/plugin/oauth"); sfOAuthPlugin.logout(); -- fails. It is not only my app, I can easily reproduce this problem with the stock ContactExplorer sample from the SDK. The problem occurs more often when you logout and then subsequently login with a different login name. Problem description:
1. Enter name and password
2. In 2nd screen grant permission by taping Allow
3. After a few seconds, the first screen comes back up with name and password empty
Again, the problem is not consistent; sometimes I can re-login over and over. I tried with the 2.06 and 2.1 version of the SDK, and on a 2013 Nexus 7 with the latest Android 4.4.2 and emulators with Android 4.3 (they all show the problem). The ContactExplorer sample is built on Windows 7 with the latest SDK from Github without any changes on my part. Most of the time, re-installing the app solves the problem but here again, not consistently. I have not tested this functionality for a while so I cannot tell you when the problem crept in. Let me provide you with the logs and the ContactExplorer that I built.
When you have a chance, please take a look at the problem. Since I am close to shipping my app, I am hoping you will be able to reproduce this problem so it can be fixed in the next SDK release. If you need me to do some more expirementation, let me know.
Thanks
Peter
https://dl.dropboxusercontent.com/u/40554620/Logs/contact-explorer-login-after-logout.txt
https://dl.dropboxusercontent.com/u/40554620/Logs/contact-explorer-logout.txt
https://dl.dropboxusercontent.com/u/40554620/Logs/ContactExplorer.apk
Hi Peter,
I have seen this issue (albeit not consistently) in my hybrid app using the Mobile SDK 2.1 as well. Since you have already collected the logs as well, I would encourage you post this as a bug on the Mobile SDK github repo - https://github.com/forcedotcom/SalesforceMobileSDK-Android/issues?page=1&state=open
I believe someone from the Mobile SDK team would respond to it there.
Regards,
Gaurav Kheterpal
Dev401 Certified Developer | Force.com Discussion Boards Moderator | Salesforce Community Mobile Evangelist