ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.71k stars 2.24k forks source link

Size limit for a String exceeded #4605

Closed aPaci95 closed 7 years ago

aPaci95 commented 7 years ago

Ankidroid says that I exceeded the size limit for a String in the database, and doesn't let me use it. I read about this error in FAQ, but I can't understand how to fix this problem. Can anybody help me?

timrae commented 7 years ago

Are you using Anki desktop?

On Mar 13, 2017 05:36, "aPaci95" notifications@github.com wrote:

Ankidroid says that I exceeded the size limit for a String in the database, and doesn't let me use it. I read about this error in FAQ, but I can't understand how to fix this problem. Can anybody help me?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ankidroid/Anki-Android/issues/4605, or mute the thread https://github.com/notifications/unsubscribe-auth/ACsA4obKgniu1UtxTRU9Sjdva0ivGcgmks5rlFdSgaJpZM4Maqp8 .

aPaci95 commented 7 years ago

Yes, but on anki desktop it works fine

timrae commented 7 years ago

As written in the FAQ, Android has a smaller limit than PC. You'll need to do "manage note types" on desktop and delete some of the note types which you're not using.

On Mar 13, 2017 9:09 AM, "aPaci95" notifications@github.com wrote:

Yes, but on anki desktop it works fine

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ankidroid/Anki-Android/issues/4605#issuecomment-285989548, or mute the thread https://github.com/notifications/unsubscribe-auth/ACsA4vEuFovYxC8L9suXmvr4PjQinreMks5rlIkxgaJpZM4Maqp8 .

aPaci95 commented 7 years ago

I already done this and the only note types left are basic and cloze deletion... I also uninstalled some plugins, but I still can't use anki on android. I have a collection of 28'000 cards, but I read online that someone have 100k-200k cards and they works fine, so I think this isn't the problem. Do you have any advice?

timrae commented 7 years ago

I already done this and the only note types left are basic and cloze deletion

After deleting the note types, you need to sync from AnkiDesktop. After syncing from Anki Desktop you need to do "full sync from server" in AnkiDroid.

I also uninstalled some plugins I read online that someone have 100k-200k cards and they works fine

Anki Desktop plugins and the number of cards in your collection are not related to this issue in any way.

aPaci95 commented 7 years ago

I already done this and it still doesn't work..

timrae commented 7 years ago

Can you post a video or screenshots of each step you took? The most likely possibility is that you made a mistake somewhere.

timrae commented 7 years ago

Also, how many decks do you have? Do any of them have a very long deck description? I think you can see / edit the deck description in deck options on Anki Desktop.

hssm commented 7 years ago

With the inclusion of the sqlite-android library, the string limit issue is no longer valid. Most likely, a different error is occurring but is being captured by the exception handler for that issue. I.e., the error message is wrong and misleading us.

Post a copy of your collection.anki2 file here so I can take a look at it.

timrae commented 7 years ago

With the inclusion of the sqlite-android library, the string limit issue is no longer valid.

Oh, have you been able to confirm this? IIRC before you were saying it "might" be fixed? Do you know what the new size limit is? 2GB? I forgot that we were just swallowing the IllegalStateException to test for this issue.

timrae commented 7 years ago

The stackoverflow thread that I originally found when researching this issue blamed it on the cursor window size, but skimming the source code it would seem we'd get a CursorWindowAllocationException rather than an IllegalStateException in this case.

However if the above were to somehow be the culprit, we might get the same error even with the new library due to their Android API wrapper.

hssm commented 7 years ago

I remember testing it on an apkg file that failed to import because of this issue (where the check is bypassed). It was working with the new library. I don't seem to have that file anymore though.

timrae commented 7 years ago

I emailed you the original apkg from #4031. For me it won't import, saying invalid apkg... I don't have time to check it right now though.

hssm commented 7 years ago

Welp, looks like I'm completely wrong about this. Not sure how I had myself convinced it was fixed. Sorry for wasting your time.

timrae commented 7 years ago

Was it the same problem preventing from opening it though...?

hssm commented 7 years ago

Yes, since we need to open it to import it, it's exactly the same. It's just that the check is done in DeckPicker while the importer doesn't go through that route.

timrae commented 7 years ago

I see, well good to know at least... Do you think it's worth us using a custom jar with larger cursor size?

On Mar 14, 2017 11:42 AM, "Houssam Salem" notifications@github.com wrote:

Yes, since we need to open it to import it, it's exactly the same. It's just that the check is done in DeckPicker while the importer doesn't go through that route.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ankidroid/Anki-Android/issues/4605#issuecomment-286305399, or mute the thread https://github.com/notifications/unsubscribe-auth/ACsA4lsNlNtFWVrmlb1WLI5zpqjrSAjGks5rlf6ngaJpZM4Maqp8 .

hssm commented 7 years ago

Possibly. I will check first with the library author about increasing the value or having it configurable.

aPaci95 commented 7 years ago

@timrae I have a lot of decks (I use sub-deck organization), but I don't use deck descriptions at all. I'm going to take some screen of each step, but this afternoon I have to take a plane and I won't be able to answer here for at least 4 days

@hssm https://mega.nz/#!n4VigKhL!a0vFZcJB4frhpOIkQD_5x2OFDdQTjQfv5xp2eEgJWcc this is my collection.anki2

aPaci95 commented 7 years ago
2 3 5 6 7 8 9 10
aPaci95 commented 7 years ago

Any advice?

timrae commented 7 years ago

It looks like the collection on ankiweb might be corrupt somehow irrespective of the string oversize issue. In the Anki desktop manual there's a procedure written for dealing with corrupt collections... Can you try it?

timrae commented 7 years ago

If that doesn't work one of us will have to see if we can reproduce the issue