AnkiDroid 2.23.1 crashes on importing large apkg deck

I have AnkiDroid 2.23.1 installed on two phones - one old phone running stock Android 10 (which is offline most of the time) and another phone running GrapheneOS Android 16.

I have a deck package which is 155MB in size. I imported that deck on the old Android 10 phone with no problems, and it works just fine.

But when I try to import the same deck on the Android 16 phone, the app immediately crashes.

If I restart the app, it’s the same as it was before the crash - no decks, and I can repeat the import, but it always crashes.

I tried clearing the cache but that makes no difference. I’ve also tried uninstalling and reinstalling the app.

The strange thing is, although the import apparently fails, the app cache size increases from 0 bytes to 155MB, the exact same size as the deck I’m trying to import.





AnkiDroid log extract - failed deck import


12-20 18:37:03.621 30365 30365 I AnkiDroid: DeckPicker:: Import button pressed
12-20 18:37:03.623 30365 30365 I AnkiDroid: DeckPicker::ImportFileSelectionFragment::onAttach
12-20 18:37:03.624 30365 30365 I AnkiDroid: DeckPicker::ImportFileSelectionFragment::onCreate
12-20 18:37:03.646 30365 30365 I AnkiDroid: DeckPicker::ImportFileSelectionFragment::onStart
12-20 18:37:03.646 30365 30365 I AnkiDroid: DeckPicker::ImportFileSelectionFragment::onResume
12-20 18:37:03.646 30365 30365 D WindowOnBackDispatcher: setTopOnBackInvokedCallback (unwrapped): null
12-20 18:37:03.648 30365 30365 D WindowOnBackDispatcher: setTopOnBackInvokedCallback (unwrapped): android.app.Dialog$$ExternalSyntheticLambda2@a9a016e
--------- switch to events
12-20 18:37:03.658 30365 30365 I viewroot_draw_event: \[window=VRI\[DeckPicker\],event=reportDrawFinished seqId=0\]
12-20 18:37:03.701 30365 30365 I viewroot_draw_event: \[window=VRI\[DeckPicker\],event=reportDrawFinished seqId=0\]
--------- switch to main
12-20 18:37:03.994 30365 30434 D HWUI    : endAllActiveAnimators on 0xb40000687afc95f0 (e2) with handle 0xb40000689afc8d00
12-20 18:37:04.039 30365 30488 D ProfileInstaller: Skipping profile installation for com.ichi2.anki
12-20 18:37:05.316 30365 30365 D WindowOnBackDispatcher: setTopOnBackInvokedCallback (unwrapped): null
12-20 18:37:05.329 30365 30365 W InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
12-20 18:37:05.330 30365 30365 I AnkiDroid: DeckPicker::ImportFileSelectionFragment::onPause
12-20 18:37:05.331 30365 30365 I AnkiDroid: DeckPicker::ImportFileSelectionFragment::onStop
12-20 18:37:05.331 30365 30365 I AnkiDroid: DeckPicker::ImportFileSelectionFragment::onViewDestroyed
12-20 18:37:05.331 30365 30365 I AnkiDroid: DeckPicker::ImportFileSelectionFragment::onDestroy
12-20 18:37:05.331 30365 30365 I AnkiDroid: DeckPicker::ImportFileSelectionFragment::onDetach
--------- switch to system
12-20 18:37:05.353 30365 30365 D InsetsController: hide(ime())
--------- switch to main
12-20 18:37:05.353 30365 30365 I ImeTracker: com.ichi2.anki:f89e73c2: onCancelled at PHASE_CLIENT_ALREADY_HIDDEN
--------- switch to events
12-20 18:37:05.943 30365 30365 I view_enqueue_input_event: \[eventType=Motion - Cancel,action=com.ichi2.anki/com.ichi2.anki.DeckPicker\]
12-20 18:37:05.952 30365 30365 I wm_on_top_resumed_lost_called: \[Token=190510287,Component Name=com.ichi2.anki.DeckPicker,Reason=topStateChangedWhenResumed\]
--------- switch to main
12-20 18:37:07.018 30365 30365 I AnkiDroid: DeckPicker::onPause
--------- switch to events
12-20 18:37:07.018 30365 30365 I wm_on_paused_called: \[Token=190510287,Component Name=com.ichi2.anki.DeckPicker,Reason=performPause,time=0ms\]
--------- switch to main
12-20 18:37:07.020 30365 30365 D WindowOnBackDispatcher: setTopOnBackInvokedCallback (unwrapped): android.app.Activity$$ExternalSyntheticLambda0@aefc5e
12-20 18:37:07.031 30365 30365 I AnkiDroid: DeckPicker::onStop
--------- switch to events
12-20 18:37:07.034 30365 30365 I wm_on_stop_called: \[Token=190510287,Component Name=com.ichi2.anki.DeckPicker,Reason=STOP_ACTIVITY_ITEM,time=3ms\]
--------- switch to main
12-20 18:37:07.036 30365 30365 I AnkiDroid: DeckPicker::onSaveInstanceState
12-20 18:37:07.046 30365 30365 I AnkiDroid: DeckPicker::onDestroy
12-20 18:37:07.046 30365 30365 D WindowOnBackDispatcher: setTopOnBackInvokedCallback (unwrapped): null
--------- switch to events
12-20 18:37:07.049 30365 30365 I wm_on_destroy_called: \[Token=190510287,Component Name=com.ichi2.anki.DeckPicker,Reason=performDestroy,time=3ms\]
--------- switch to main
12-20 18:37:07.059 30365 30365 D ViewRootImpl: Skipping stats log for color mode

Apologies for the unformatted log text. I tried to follow the formatting tips but it seems I got it wrong.

[I edited your post to un-comment-out the backticks. See if that’s what you were going for. ]

If you already imported it, you shouldn’t need to import it again. It should be synced in your AnkiWeb account, and will download to your new device when you set up syncing. [This doesn’t directly solve the issue, but it will get you past it for now.]

Ok then, I’ll setup an Anki account and see if the sync method you suggest will solve the issue for now.

Would be nice if someone in your dev team could look into an actual fix for the crash though, but I understand there may well be higher priority issues that they are busy dealing with right now.

Thanks for re-formatting my post. Much neater!

I just thought, maybe I’ve already got an Anki account. What I mean is, when I created an account for this forum I thought it was just for the forum but perhaps it’s the same credentials for synching. I’ll have to check.

They see all reports and will let you know if they need more information.

Whether you used the same login credentials or not, it’s not the same account. Your account for posting here is part of this Discourse forum. Your account for syncing would be an AnkiWeb account – Syncing with AnkiWeb - Anki Manual .

Hi, could you copy Settings - About - Copy debug info.

If you’re running the full build (F-Droid/GitHub), could you check for filesystem permission corruption by temporarily opening our play build: https://github.com/ankidroid/Anki-Android/releases/download/v2.23.1/dev-AnkiDroid-2.23.1-play-universal.apk. If it doesn’t show a fatal error, it’s fine to uninstall.

Ok thanks.

First, I was running the arm64-v8a build which I obtained from GitHub. Oddly, in the debug info, it appeared as “ProductFlavor = play”.

So I uninstalled that build and installed the ‘full-universal’ build. On running this build for the first time, the app requested ‘All files access’ which I granted. This request did not appear with the arm64-v8a build, and in that build, Settings > Advanced showed AnkiDroid directory to be a deeply buried one (the actual app directory, I suppose).

With the ‘full-universal’ build, the AnkiDroid directory is < storage/emulated/0/AnkiDroid > which is easily accessible in my file manager.

I also went to App Info > Permissions and granted All Notifications permission (although that permission had not yet been requested by the app).

Unfortunately, the full-universal build also crashed when importing the deck package.

Finally I tried the ‘play-universal’ build. It did not show a fatal error, but it crashed on deck import the same as the other builds.

I’ve reinstalled the full-universal build for now.

One other thing - this being GrapheneOS, there are some extra settings available in App Info that you don’t get with stock, one of them being “Exploit protection compatibility mode”, which was disabled by default with all builds - but I did try enabling it, again with all builds, just to see if that changed anything in the app’s behaviour, but it didn’t.

Finally, here’s the debug info from the full-universal build.

AnkiDroid Version = 2.23.1 (3f3133b496b531383e9a6494f5a7704634935308)
Backend Version = 0.1.62-anki25.09.2 (25.09.2 3890e12c9e48c028c3f12aa58cb64bd9f8895e30)
Android Version = 16 (SDK 36)
ProductFlavor = full
Device Info = Google | google | oriole | oriole | Pixel 6 | oriole
Webview User Agent = Mozilla/5.0 (Linux; Android 16; Pixel 6 Build/BP4A.251205.006; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/143.0.7499.146 Mobile Safari/537.36
ACRA UUID = e4a312b9-2fb5-41e3-942d-8d53f7624322
FSRS = 5.1.0 (Enabled: false)
Crash Reports Enabled = true

By the way, I use many apps downloaded from GitHub, and I always download the arm64-v8a build, rather than the universal (when there there is a choice). I’ve always figured, why download an apk that’s got two, or even four builds in it (arm64-v8a, armeabi-v7a, x86, x86_64) when all I need is arm64-v8a - and I’ve never had any problems before. But as noted above, the AnkiDroid arm64-v8a build does not ask for all files access and the AnkiDroid directory is inaccessible to a standard user. So to get that ‘feature’ you have to download 102MB of data rather than 32MB.

No reports in our crash report database.

Could you go to Help - Get help - Send troubleshooting report

Or provide the stack trace (as you seem to have logcat setup).

Filesystem permission corruption only blocks installs where we can’t request MANAGE_EXTERNAL_STORAGE, (Play Store only), and the Play Store has their own mechanism to handle compression of the app

1 Like

Thought you might like to know I just installed <AnkiDroid-2.23.2-full-universal.apk> from GitHub (clean install) and was able to import the 155MB deck with no problems. It’s all working good.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.