Skip to content

[Loading Indicator] ArrayIndexOutOfBoundsException #4632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
brahmkshatriya opened this issue Feb 28, 2025 · 3 comments
Open

[Loading Indicator] ArrayIndexOutOfBoundsException #4632

brahmkshatriya opened this issue Feb 28, 2025 · 3 comments

Comments

@brahmkshatriya
Copy link

Description: Stack Trace

java.lang.ArrayIndexOutOfBoundsException: length=7; index=-2
                           	at com.google.android.material.loadingindicator.LoadingIndicatorDrawingDelegate.drawIndicator(LoadingIndicatorDrawingDelegate.java:122)
                           	at com.google.android.material.loadingindicator.LoadingIndicatorDrawable.draw(LoadingIndicatorDrawable.java:108)
                           	at com.google.android.material.loadingindicator.LoadingIndicator.onDraw(LoadingIndicator.java:120)
                           	at android.view.View.draw(View.java:24627)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23493)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4566)
                           	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4539)
                           	at android.view.View.updateDisplayListIfDirty(View.java:23449)
                           	at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:694)
                           	at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:700)
                           	at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:798)
                           	at android.view.ViewRootImpl.draw(ViewRootImpl.java:5313)
                           	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4975)
                           	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4093)
                           	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2718)
                           	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9941)
                           	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1406)
                           	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1415)
28234 AndroidRuntime    E  	at android.view.Choreographer.doCallbacks(Choreographer.java:1015) (Ask Gemini)
                           	at android.view.Choreographer.doFrame(Choreographer.java:945)
                           	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1389)
                           	at android.os.Handler.handleCallback(Handler.java:959)
                           	at android.os.Handler.dispatchMessage(Handler.java:100)
                           	at android.os.Looper.loopOnce(Looper.java:232)
                           	at android.os.Looper.loop(Looper.java:317)
                           	at android.app.ActivityThread.main(ActivityThread.java:8592)
                           	at java.lang.reflect.Method.invoke(Native Method)
                           	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:583)
                           	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

Material Library version: 1.13.0-alpha11

XML:

<com.google.android.material.loadingindicator.LoadingIndicator
                android:id="@+id/progressBar"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:clickable="false"
                android:indeterminate="true"
                app:containerColor="?colorTertiaryContainer"
                app:indicatorColor="?colorTertiary"
                app:indicatorSize="64dp" />
@drchen
Copy link
Contributor

drchen commented Feb 28, 2025

@pekingme can you take a look?

@pekingme
Copy link
Contributor

pekingme commented Mar 3, 2025

I can't repro this exception with the included xml snippet in the catalog. Do you have more programmatic code for this component?

@brahmkshatriya
Copy link
Author

brahmkshatriya commented Mar 3, 2025

I can't repro this exception with the included xml snippet in the catalog. Do you have more programmatic code for this component?

@pekingme yes, I was changing the indicatorColor on runtime, which depending on frame of the animation gave this error once in a while

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants