-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[InitialActivity::getStartupFailureType] StorageAccessException: Failed to create AnkiDroid directory /storage/emulated/0/AnkiDroid
#17373
Comments
/storage/emulated/0/AnkiDroid
/storage/emulated/0/AnkiDroid
/storage/emulated/0/AnkiDroid
Do we need to do anything here? This is what the user sees on Android 13 when this error is triggered: I'd propose that we silence this exception if using the default path. Nothing further that we can do EDIT: Code I used to trigger the exception Index: AnkiDroid/src/main/java/com/ichi2/anki/preferences/DevOptionsFragment.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/preferences/DevOptionsFragment.kt b/AnkiDroid/src/main/java/com/ichi2/anki/preferences/DevOptionsFragment.kt
--- a/AnkiDroid/src/main/java/com/ichi2/anki/preferences/DevOptionsFragment.kt (revision 6953d60532ee2762d29b06fd1d76e69203ad8455)
+++ b/AnkiDroid/src/main/java/com/ichi2/anki/preferences/DevOptionsFragment.kt (date 1731426260433)
@@ -17,11 +17,13 @@
import android.content.Context
import androidx.appcompat.app.AlertDialog
+import androidx.core.content.edit
import androidx.preference.Preference
import androidx.preference.SwitchPreferenceCompat
+import com.ichi2.anki.AnkiDroidApp
import com.ichi2.anki.BuildConfig
+import com.ichi2.anki.CollectionHelper
import com.ichi2.anki.CollectionManager
-import com.ichi2.anki.CrashReportService
import com.ichi2.anki.R
import com.ichi2.anki.analytics.UsageAnalytics
import com.ichi2.anki.launchCatchingTask
@@ -63,12 +65,12 @@
}
// Make it possible to test crash reporting
requirePreference<Preference>(R.string.pref_trigger_crash_key).setOnPreferenceClickListener {
- // If we don't delete the limiter data, our test crash may not go through,
- // but we are triggering it very much on purpose, we want to see the crash in ACRA
- this.context?.let { c -> CrashReportService.deleteACRALimiterData(c) }
+ val prefs = AnkiDroidApp.sharedPrefs()
+ prefs.edit {
+ putString(CollectionHelper.PREF_COLLECTION_PATH, "/storage/emulated/0/AnkiDroid")
+ }
- Timber.w("Crash triggered on purpose from advanced preferences in debug mode")
- throw RuntimeException("This is a test crash")
+ false
}
// Make it possible to test analytics
requirePreference<Preference>(R.string.pref_analytics_debug_key).setOnPreferenceClickListener { |
...is that the right basis text for the diff? seems like it's removing what we want in the trigger crash dev preference and adding in something totally unrelated? |
The Exception occurs when:
This is typically either after reinstalling, or after legacy permissions to the folder have been revoked by the Android system The patch above quickly gets AnkiDroid into the same state and is what I used for testing |
Agreed - let's silence this |
InitialActivity::getStartupFailureType
https://ankidroid.org/acra/app/1/bug/250465/report/e6b0ece8-4a72-451e-957e-97b9ff508b12
The text was updated successfully, but these errors were encountered: