Crashing application with "Clock" and "List View Image and Text" components

I checked out Kodular Fenix (v1.5.0) Bug Tracker before creating a new topic

Describe your issue

I have an app to manage wordpress woocommerce orders. Every 2,5 seconds clock fires and web component fetches orders from wordpress database with help of woocommerce rest api. The problem is that sometimes when I click item of List View Image and Text component the application crashes.

Error log
01-07 16:05:25.056 12778 12778 E AndroidRuntime: FATAL EXCEPTION: main
01-07 16:05:25.056 12778 12778 E AndroidRuntime: Process: io.makeroid.companion, PID: 12778
01-07 16:05:25.056 12778 12778 E AndroidRuntime: java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 12
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at java.util.Objects.checkIndex(Objects.java:359)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at java.util.ArrayList.get(ArrayList.java:434)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at com.google.appinventor.components.runtime.MakeroidListViewImageText.click(SourceFile:107)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at com.google.appinventor.components.runtime.MakeroidListViewBase$1.onItemClick(SourceFile:64)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at com.google.appinventor.components.runtime.RecyclerItemClickListener.onInterceptTouchEvent(SourceFile:41)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at androidx.recyclerview.widget.RecyclerView.dispatchOnItemTouch(RecyclerView.java:2962)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at androidx.recyclerview.widget.RecyclerView.onTouchEvent(RecyclerView.java:3090)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.View.dispatchTouchEvent(View.java:14572)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3169)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2813)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3175)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2827)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3175)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2827)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3175)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2827)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3175)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2827)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3175)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2827)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3175)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2827)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3175)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2827)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at com.google.appinventor.components.runtime.ScaledFrameLayout.dispatchTouchEvent(SourceFile:83)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3175)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2827)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3175)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2827)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3175)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2827)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3175)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2827)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3175)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2827)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:502)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1892)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.app.Activity.dispatchTouchEvent(Activity.java:4243)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:460)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.View.dispatchPointerEvent(View.java:14839)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6430)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6231)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5704)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5762)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5728)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5893)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5736)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5950)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5709)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5762)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5728)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5736)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5709)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8661)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8612)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8578)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8792)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.os.MessageQueue.nativePollOnce(Native Method)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.os.MessageQueue.next(MessageQueue.java:335)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:161)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:288)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7941)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:553)
01-07 16:05:25.056 12778 12778 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Steps to reproduce the issue

I created a very simple project to test this out. In the project there are only “Clock” and “List View Image and Text” components and the following blocks:

In my tests, this issue occurs only when adding items with a clock component. I recommend testing first with the clock component enabled (see below the AIA file) and then without the clock: disable clock block and enable screen1 initialize block.

ListViewImageText_test.aia (2.7 KB)

Android version

I tested this with Android 12:

  • 2 x Android 12 real/physical device (error occurs)
  • 1 x Android 12 android virtual device (In my tests on this virtual device I didn’t get this error for some reason.)

Please ask me for more details if I wasn’t clear enough.

2 Likes

it clearly says this:

Yes you are right, but I’m not trying to access any of indexes at all in my blocks. So this must be Kodular bug, right?