[Bug] Unable to open decks with latest alpha releases starting from 2.16.apha66 when "reschedule" is set to "always show" (cf settings/appearance/app bar button)
Reproduction Steps
Start with a device having AnkiDroid-2.16alpha65-armeabi-v7a.apk
- Install AnkiDroid-2.16alpha66-armeabi-v7a.apk or the following alpha release (I tried 68 and 69, skipping 67): all have the same bug (cf actual result)
Expected Result
I should be able to open my decks to do my reviews
Actual Result
The app crashes when I open a deck (filtered or not)
Debug info
Refer to the support page if you are unsure where to get the "debug info". AnkiDroid Version = 2.16alpha65
Android Version = 10
Manufacturer = Xiaomi
Model = Redmi 7A
Hardware = qcom
Webview User Agent = Mozilla/5.0 (Linux; Android 10; Redmi 7A Build/QKQ1.191014.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/102.0.5005.125 Mobile Safari/537.36
ACRA UUID = 98814994-580a-48ca-b76d-4a40ea9ea6fa
Scheduler = std2
Crash Reports Enabled = true
DatabaseV2 Enabled = true
Research
Enter an [x] character to confirm the points below:
- [x] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
- [x] I have checked the manual and the FAQ and could not find a solution to my issue
- [x] I have searched for similar existing issues here and on the user forum
- [x] (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions) Actually the bug comes from the latest alpha releases
I don't reproduce this personally (so perhaps a check database would help?) but I do see your crash!
Comment
on the last card of a review, i change the deck of the card via the edit button.
Stacktrace (No mapping found)
java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter value
at com.ichi2.anki.AbstractFlashcardViewer$mUpdateCardHandler$1.onProgressUpdate(Unknown Source:2)
at com.ichi2.anki.AbstractFlashcardViewer$mUpdateCardHandler$1.onProgressUpdate(AbstractFlashcardViewer.kt:1)
at com.ichi2.async.CollectionTask.onProgressUpdate(CollectionTask.kt:2)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:775)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7562)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
https://ankidroid.org/acra/app/1/bug/2651/report/3df33eb7-af8b-422a-b4c5-88a4ffa83c37
logcat in case it is useful
--------- beginning of main
06-23 19:44:57.664 I/AnkiDroid(26578): stop: automatically show question
06-23 19:44:57.665 I/AnkiDroid(26578): AbstractFlashcardViewer:: EASE_3 pressed
06-23 19:44:57.668 I/AnkiDroid(26578): Answering card 1653052229141
06-23 19:44:57.684 I/AnkiDroid(26578): Rust: executeGetRowsAffected UPDATE cards SET factor=?,lapses=?,did=?,due=?,ivl=?,mod=?,usn=?,left=?,odid=?,odue=?,reps=?,type=?,queue=? WHERE id = ?
06-23 19:44:57.696 I/AnkiDroid(26578): Obtaining card
06-23 19:44:57.713 I/AnkiDroid(26578): ViewGroupUtils::setRenderWorkaround - using default / hardware rendering
06-23 19:44:57.723 I/AnkiDroid(26578): AbstractFlashcardViewer:: Question successfully shown for card id 1652106363250
--------- beginning of system
06-23 19:46:05.573 I/AnkiDroid(26578): AnkiActivity::onPause - Reviewer
06-23 19:46:05.579 I/AnkiDroid(26578): stop: automatically show answer
06-23 19:46:05.579 I/AnkiDroid(26578): stop: automatically show question
06-23 19:47:38.481 I/AnkiDroid(26578): AnkiActivity::onResume - Reviewer
06-23 19:47:40.671 I/AnkiDroid(26578): stop: automatically show question
06-23 19:47:40.671 I/AnkiDroid(26578): AbstractFlashcardViewer:: EASE_3 pressed
06-23 19:47:40.694 I/AnkiDroid(26578): Answering card 1652106363250
06-23 19:47:40.852 I/AnkiDroid(26578): Rust: executeGetRowsAffected UPDATE cards SET factor=?,lapses=?,did=?,due=?,ivl=?,mod=?,usn=?,left=?,odid=?,odue=?,reps=?,type=?,queue=? WHERE id = ?
06-23 19:47:40.869 I/AnkiDroid(26578): Obtaining card
06-23 19:47:40.895 I/AnkiDroid(26578): ViewGroupUtils::setRenderWorkaround - using default / hardware rendering
06-23 19:47:40.919 I/AnkiDroid(26578): AbstractFlashcardViewer:: Question successfully shown for card id 1643137936827
06-23 19:48:24.281 I/AnkiDroid(26578): stop: automatically show question
06-23 19:48:24.281 I/AnkiDroid(26578): AbstractFlashcardViewer:: EASE_2 pressed
06-23 19:48:24.284 I/AnkiDroid(26578): Answering card 1643137936827
06-23 19:48:24.303 I/AnkiDroid(26578): Rust: executeGetRowsAffected UPDATE cards SET factor=?,lapses=?,did=?,due=?,ivl=?,mod=?,usn=?,left=?,odid=?,odue=?,reps=?,type=?,queue=? WHERE id = ?
06-23 19:48:24.317 I/AnkiDroid(26578): Obtaining card
06-23 19:48:24.333 I/AnkiDroid(26578): ViewGroupUtils::setRenderWorkaround - using default / hardware rendering
06-23 19:48:24.344 I/AnkiDroid(26578): AbstractFlashcardViewer:: Question successfully shown for card id 1652106363279
06-23 19:48:30.145 I/AnkiDroid(26578): stop: automatically show question
06-23 19:48:30.145 I/AnkiDroid(26578): AbstractFlashcardViewer:: EASE_3 pressed
06-23 19:48:30.149 I/AnkiDroid(26578): Answering card 1652106363279
06-23 19:48:30.165 I/AnkiDroid(26578): Rust: executeGetRowsAffected UPDATE cards SET factor=?,lapses=?,did=?,due=?,ivl=?,mod=?,usn=?,left=?,odid=?,odue=?,reps=?,type=?,queue=? WHERE id = ?
06-23 19:48:30.177 I/AnkiDroid(26578): Obtaining card
06-23 19:48:30.193 I/AnkiDroid(26578): ViewGroupUtils::setRenderWorkaround - using default / hardware rendering
06-23 19:48:30.220 I/AnkiDroid(26578): AbstractFlashcardViewer:: Question successfully shown for card id 1652841926722
06-23 19:48:41.493 I/AnkiDroid(26578): Reviewer:: Edit note button pressed
06-23 19:48:41.581 I/AnkiDroid(26578): AnkiActivity::onPause - Reviewer
06-23 19:48:41.581 I/AnkiDroid(26578): stop: automatically show answer
06-23 19:48:41.581 I/AnkiDroid(26578): stop: automatically show question
06-23 19:48:41.677 I/AnkiDroid(26578): AnkiActivity::onCreate - NoteEditor
06-23 19:48:41.850 I/AnkiDroid(26578): onCollectionLoaded() Edit note activity successfully started with card id 1652841926722
06-23 19:48:41.852 I/AnkiDroid(26578): AnkiActivity::onStart - NoteEditor
06-23 19:48:41.857 I/AnkiDroid(26578): AnkiActivity::onResume - NoteEditor
06-23 19:48:42.555 I/AnkiDroid(26578): AnkiActivity::onStop - Reviewer
06-23 19:48:42.580 I/AnkiDroid(26578): Rust: executeGetRowsAffected UPDATE col SET dconf=?,decks=?
06-23 19:48:42.600 I/AnkiDroid(26578): flush - Saving information to DB...
06-23 19:48:42.601 I/AnkiDroid(26578): Rust: executeGetRowsAffected UPDATE col SET ls=?,crt=?,dty=?,mod=?,scm=?,usn=?,conf=?
06-23 19:48:46.389 I/AnkiDroid(26578): NoteEditor:: Save note button pressed
06-23 19:48:46.444 I/AnkiDroid(26578): finishWithAnimation END
06-23 19:48:46.454 I/AnkiDroid(26578): AnkiActivity::onPause - NoteEditor
06-23 19:48:46.467 I/AnkiDroid(26578): Handling Activity Result: 0. Result: -1
06-23 19:48:46.467 I/AnkiDroid(26578): Creating notification channel with id/name: General Notifications/AnkiDroid
06-23 19:48:46.468 I/AnkiDroid(26578): Creating notification channel with id/name: Synchronization/Synchronization
06-23 19:48:46.469 I/AnkiDroid(26578): Creating notification channel with id/name: Global Reminders/Cards due
06-23 19:48:46.470 I/AnkiDroid(26578): Creating notification channel with id/name: Deck Reminders/Reminders
06-23 19:48:46.471 I/AnkiDroid(26578): AbstractFlashcardViewer:: Saving card...
06-23 19:48:46.471 I/AnkiDroid(26578): Obtaining card
06-23 19:48:46.478 I/AnkiDroid(26578): AnkiActivity::onStart - Reviewer
06-23 19:48:46.483 I/AnkiDroid(26578): AnkiActivity::onResume - Reviewer
06-23 19:48:46.484 I/AnkiDroid(26578): ExecuteCommand: localMinutesWest
06-23 19:48:46.511 E/AnkiDroid(26578): BaseAsyncTask/ must be called on the main thread instead of Thread[AsyncTask #10,5,main]
06-23 19:48:46.511 E/AnkiDroid(26578): BaseAsyncTask/ must be called on the main thread instead of Thread[AsyncTask #10,5,main]
06-23 19:48:46.529 I/AnkiDroid(26578): Rust: transaction begin
06-23 19:48:46.548 I/AnkiDroid(26578): Rust: transaction commit
06-23 19:48:46.551 I/AnkiDroid(26578): ExecuteCommand: localMinutesWest
06-23 19:48:46.561 I/AnkiDroid(26578): ViewGroupUtils::setRenderWorkaround - using default / hardware rendering
06-23 19:48:46.572 I/AnkiDroid(26578): AbstractFlashcardViewer:: Question successfully shown for card id 1652841926722
--------- beginning of crash
I believe there was some nullability changes in the area between alpha65 and alpha66 so a bisect there and examination of assumptions may be useful
https://github.com/ankidroid/Anki-Android/compare/v2.16alpha65...v2.16alpha66
That was a big release unfortunately - hopefully with the stack trace + logcat and a git blame - even in the absence of de-obfuscated symbols - this is possible to track down
I don't reproduce this personally (so perhaps a check database would help?) but I do see your crash!
I forgot to mention in this issue that I have checked the database several times both on ankidroid and anki desktop (before and after the updates)
Also, for the full story, I was first on 62. Then I had the bug mentioned here. I checked my database several times and as it didn't solve the bug with "all decks", I installed 69. It didn't fix the bug with "all decks" and I couldn't open any deck. I checked the database which didn't solve anything. Then I installed 68, which had the same bug as 69. I reinstalled 62 (I could open my decks but not use "all decks"). I then installed 63, 64,65, and 66. On 66 I had the same bug as 69 so I went back to 65.
Now that the problem with "all decks" is fixed thanks to you, I have updated again to the latest alpha version. I am still getting the same bug: I can use the cards browser and see the statistics but when I open a deck for a review, the app crashes. I have created a new deck "0 100 test" with only 1 card with the basic note template to rule out any customization I have maybe to my deck/cards but even with this simple test case, the app crashes when I open the deck for a review. I have sent you a new bug report and a new colpkg on the email written you github profile.
Let me know if I can do something else to try to solve this bug.
Thanks a lot for your help!
Thanks a lot!
-
So, I finally found the culprit: it's the display of "reschedule" in the app bar: When I set "reschedule" to "always show" in the settings for the app bar (settings/appearance/app bar button), then the app crashes when I open a deck for review. If I set "reschedule" to something else (show if room, menu only...) then everything is working fine. The bug is there even if I set "menu only" for all of the other actions and let "reschedule" as "always show".
-
Possibly another bug (or a new feature request) concerning how the settings are saved: I found out about this because of what I perceive to be another bug. Let me know if you want me to open an issue for this. So, because I wanted to test the newest alpha release with a clean Anki, I closed Anki and renamed the
Anki(the one containing collection.media and collection.anki2) folder toAnkiBKP(to keep/save all my data). Then I uninstall Anki and install Anki alpha 69. Then in this freshly installed Anki (linked to a clean Anki folder), I created a new deck, a new card and I started a review. I didn't have any bugs so I wanted to test again on my "real Anki folder". So, I closed Anki, deleted the Anki folder and renamedAnkiBKPtoAnkithen I opened Anki. I thought I would get Anki exactly as it was before this test but, although I got my decks back (with the right schedule/progress), I didn't get my settings back. This is what I think is a bug because it's strange that the settings of Anki aren't saved in this folder. Although it was a good thing in this case, because it forced to set my settings up again (which I did one by one, testing each time by opening a deck), I still think everything should be saved in this Anki folder so that we only have to copy it to reinstall Anki as it was. Sorry, that was a long explanation but I didn't find a way to make it shorter while keeping the explanation clear
Edit: I was able to reproduce the bug with "reschedule" set to "always show" on a second phone.
Edit2: Also "reschedule" doesn't show up in the app bar when it is set to "show if room" and the phone and Anki are in landscape (and thus there is plenty of room to show it). This doesn't happen with the other action from the app bar that I tested (card info, edit card...)
Same problem with the last version (alpha75): when I set the reschedule button to "always show", the app crashes when I open a deck to review the cards.
If it's because there is not enough space, it'd great to either put the deck name just on the "div" below (which shows the number of red and green cards for today) or to put it somewhere on the drop-down menu or to simply remove it. The deck's name is not really essential and takes the space of 2, maybe 3 buttons, it's a shame.
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
I cannot reproduce "reschedule set to always show" in 2.16alpha90.
"Reschedule set to show if room doesn't show up in landscape" still reproducible.
@pavreh, thanks for sharing this. I updated to 2.16alpha90 (via armeabi-v7a) and I don't have any of the bugs mentioned about reschedule anymore.
In the meantime, I learned about the function AnkiDroidJS.ankiSetCardDue(delayInt); and I am not using the reschedule menu item as it's quicker (and way easier with gloves on!) to do it via a button added to the screen.
I see. There is a room only for four "show if room" buttons even in landscape. So the bug here is not reproducible.
I can't reproduce it either, thanks @pavreh and @MagTun for the help!