android / android/codelab-android-datastore
CRASH: Unable to delete SharedPreferences: prefs_name
- Dominant language
- Kotlin
- Stars
- 240
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Description
I can see crashes in firebase caused by this, mostly on devices with android 8 and more (mostly Samsung devices).
App crashes during migration from shared preferences when trying to delete shared prefs.
Can somebody explain me why are you throwing IOException if deleteSharedPreferences() returns false on api >= 24, but you are silently continuing when prefs aren't able to delete on api < 24? Why can't you silently continue also for api >= 24?
Thank you for your answer.

Contributor guide
Research direction
Start by locating the migration code that calls deleteSharedPreferences() and compare its API >=24 and API <24 handling. Reproduce the failed deletion on an affected Android version, then verify the agreed behavior for deletion failure and cover it with the relevant test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100