ankidroid / Anki-Android

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

Crash 2.14.0 IndexOutOfBoundsException in NoteEditor.removeButton #7724

Closed mikehardy closed 3 years ago

mikehardy commented 3 years ago

Popped up in the 2.14.0 firebase test lab on the release auto-testing that google does

FATAL EXCEPTION: Thread-6
Process: com.ichi2.anki, PID: 12322
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.remove(ArrayList.java:503)
    at com.ichi2.anki.NoteEditor.removeButton(NoteEditor.java:2)
    at com.ichi2.anki.NoteEditor.u(NoteEditor.java:1)
    at com.ichi2.anki.v4.onClick(Unknown Source:4)
    at com.afollestad.materialdialogs.MaterialDialog.onClick(MaterialDialog.java:7)
    at android.view.View.performClick(View.java:6297)
    at android.view.View$PerformClick.run(View.java:24797)
    at android.os.Handler.handleCallback(Handler.java:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at androidx.test.espresso.base.Interrogator.a(Interrogator.java:11)
    at androidx.test.espresso.base.UiControllerImpl.n(UiControllerImpl.java:6)
    at androidx.test.espresso.base.UiControllerImpl.m(UiControllerImpl.java:1)
    at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:6)
    at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:15)
    at androidx.test.espresso.action.Tap.b(Unknown Source:9)
    at androidx.test.espresso.action.Tap$1.sendTap(Tap.java:1)
    at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:4)
    at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:4)
    at androidx.test.espresso.ViewInteraction.a(Unknown Source:137)
    at androidx.test.espresso.ViewInteraction$1.call(Unknown Source:4)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at android.os.Handler.handleCallback(Handler.java:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6647)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
david-allison commented 3 years ago

Likely a double-tap - I don't think this is possible via a regular user as it requires a long-press to activate the delete confirmation code.

But, I'll take a look - can't have automated tests crashing. Do you have the associated video?

mikehardy commented 3 years ago

Oh I didn't attach that, sorry - https://youtu.be/UlM_k1iQfPw

mikehardy commented 3 years ago

looked at this again to see if it was worth it for 2.14.1 but given initial triage that it's just an impossible auto-testing double-tap I think it can wait, bumping it to 2.14.2 so I can get 2.14.1 out now with it's pile of fixes

github-actions[bot] commented 3 years ago

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