Closed jbreitfeller-sfix closed 1 year ago
Hi @jbreitfeller-sfix thanks for using the Braintree SDK for Android. I'm not sure exactly what would cause this error, but it appears to be coming from the 3rd party Jetpack library we're using for encrypted shared prefs.
Is this 100% reproducible? If so, could you set a break point here in DropInActivity.java and inspect the error?
I'll see if I can find a device to recreate this on again. After clearing my data on the phone, the issue went away. I'll say we had a similar issue with EncryptedSharedPreferences, but that was when a user would backup our app and then migrate to a different phone. Essentially, the encryption key on the device would no longer match the file and would throw an odd error like this. We ended up just catching that exception, deleting the shared preferences, and then re-opening the file.
That may have been the case here as well... 🤔
If I modify the BraintreeApi.xml shared preferences file I am able to recreate the same stack trace that I received above. The actual error ends up saying
com.braintreepayments.api.BraintreeSharedPreferencesException: Unable to obtain a reference to encrypted shared preferences.
As I mentioned above, we've seen this happen within our own apps encrypted preferences when a user migrated from an old phone to a new phone. This is because the shared preference file is copied over but the encryption key is obviously no longer the same. We solved this two ways
fullBackupContent
and dataExtractionRules
application tag. @jbreitfeller-sfix we've removed EncryptedSharedPreferences
in the latest 6.8.0 version. Hopefully the quality of this library will improve in the future. Feel free to re-open if this issue persists within our SDK!
General information
Issue description
Whenever I click to add a Venmo payment method, I receive this error. I was able to fix this by clearing the data on my app but I wasn't sure if maybe there was some idea as to why this was happening in the first place.