<p dir="auto"><strong>Glide Version</strong>: 4.0.0</p>

<p dir="auto"><strong>Integration libraries</strong>: None</p>

<p dir="auto"><strong>Device/Android Version</strong>: Genymotion Nexus 5X 7.1.1</p>

<p dir="auto"><strong>Issue details / Repro steps / Use case background</strong>:  While scrolling in a <code class="notranslate">RecyclerView</code> with many pictures (~60) app crashes and throws a <code class="notranslate">ConcurrentModificationException</code>.</p>

<p dir="auto"><strong>Glide load line / <code class="notranslate">GlideModule</code> (if any) / list Adapter code (if any)</strong>:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="void loadFromUrls(Context context, ImageView view, String url, String thumbUrl, RequestListener&lt;Bitmap&gt; listener, boolean transform, float sizeMultiplier) {
    
    RequestOptions options = RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE).dontAnimate();
    if (!transform) options.dontTransform();
    
    if (!thumbUrl.isEmpty()) {
        Glide.with(context).asBitmap().load(url)
                .thumbnail(Glide.with(context).asBitmap().load(thumbUrl)
                                   .thumbnail(sizeMultiplier)
                                   .apply(options.priority(Priority.IMMEDIATE)))
                .apply(options.priority(Priority.HIGH))
                .listener(listener)
                .into(view);
    } else if (!url.isEmpty()) {
        Glide.with(context).asBitmap().load(url).thumbnail(sizeMultiplier)
                .apply(options.priority(Priority.HIGH))
                .listener(listener)
                .into(view);
    }
}"><pre class="notranslate"><span class="pl-smi">void</span> <span class="pl-s1">loadFromUrls</span>(<span class="pl-smi">Context</span> <span class="pl-s1">context</span>, <span class="pl-smi">ImageView</span> <span class="pl-s1">view</span>, <span class="pl-smi">String</span> <span class="pl-s1">url</span>, <span class="pl-smi">String</span> <span class="pl-s1">thumbUrl</span>, <span class="pl-smi">RequestListener</span>&lt;<span class="pl-smi">Bitmap</span>&gt; <span class="pl-s1">listener</span>, <span class="pl-smi">boolean</span> <span class="pl-s1">transform</span>, <span class="pl-smi">float</span> <span class="pl-s1">sizeMultiplier</span>) {
    
    <span class="pl-smi">RequestOptions</span> <span class="pl-s1">options</span> = <span class="pl-en">RequestOptions</span>().<span class="pl-en">diskCacheStrategy</span>(<span class="pl-smi">DiskCacheStrategy</span>.<span class="pl-c1">RESOURCE</span>).<span class="pl-en">dontAnimate</span>();
    <span class="pl-k">if</span> (!<span class="pl-s1">transform</span>) <span class="pl-s1">options</span>.<span class="pl-en">dontTransform</span>();
    
    <span class="pl-k">if</span> (!<span class="pl-s1">thumbUrl</span>.<span class="pl-en">isEmpty</span>()) {
        <span class="pl-smi">Glide</span>.<span class="pl-en">with</span>(<span class="pl-s1">context</span>).<span class="pl-en">asBitmap</span>().<span class="pl-en">load</span>(<span class="pl-s1">url</span>)
                .<span class="pl-en">thumbnail</span>(<span class="pl-smi">Glide</span>.<span class="pl-en">with</span>(<span class="pl-s1">context</span>).<span class="pl-en">asBitmap</span>().<span class="pl-en">load</span>(<span class="pl-s1">thumbUrl</span>)
                                   .<span class="pl-en">thumbnail</span>(<span class="pl-s1">sizeMultiplier</span>)
                                   .<span class="pl-en">apply</span>(<span class="pl-s1">options</span>.<span class="pl-en">priority</span>(<span class="pl-smi">Priority</span>.<span class="pl-c1">IMMEDIATE</span>)))
                .<span class="pl-en">apply</span>(<span class="pl-s1">options</span>.<span class="pl-en">priority</span>(<span class="pl-smi">Priority</span>.<span class="pl-c1">HIGH</span>))
                .<span class="pl-en">listener</span>(<span class="pl-s1">listener</span>)
                .<span class="pl-en">into</span>(<span class="pl-s1">view</span>);
    } <span class="pl-k">else</span> <span class="pl-k">if</span> (!<span class="pl-s1">url</span>.<span class="pl-en">isEmpty</span>()) {
        <span class="pl-smi">Glide</span>.<span class="pl-en">with</span>(<span class="pl-s1">context</span>).<span class="pl-en">asBitmap</span>().<span class="pl-en">load</span>(<span class="pl-s1">url</span>).<span class="pl-en">thumbnail</span>(<span class="pl-s1">sizeMultiplier</span>)
                .<span class="pl-en">apply</span>(<span class="pl-s1">options</span>.<span class="pl-en">priority</span>(<span class="pl-smi">Priority</span>.<span class="pl-c1">HIGH</span>))
                .<span class="pl-en">listener</span>(<span class="pl-s1">listener</span>)
                .<span class="pl-en">into</span>(<span class="pl-s1">view</span>);
    }
}</pre></div>

<p dir="auto"><strong>Layout XML</strong>:</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;FrameLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
             xmlns:tools=&quot;http://schemas.android.com/tools&quot;
             xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
             android:layout_width=&quot;match_parent&quot;
             android:layout_height=&quot;wrap_content&quot;
             android:orientation=&quot;vertical&quot;
             android:foreground=&quot;?selectableItemBackground&quot;&gt;

    &lt;ImageView
            android:id=&quot;@+id/wallpaper_image&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:scaleType=&quot;centerCrop&quot;
            tools:ignore=&quot;ContentDescription&quot;/&gt;

    &lt;LinearLayout
            android:id=&quot;@+id/wallpaper_details&quot;
            android:orientation=&quot;horizontal&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;68dp&quot;
            android:paddingStart=&quot;@dimen/fabs_margin&quot;
            android:paddingLeft=&quot;@dimen/fabs_margin&quot;
            android:paddingEnd=&quot;@dimen/fabs_margin&quot;
            android:paddingRight=&quot;@dimen/fabs_margin&quot;
            android:layout_gravity=&quot;start|bottom&quot;
            android:gravity=&quot;start|bottom&quot;
            tools:ignore=&quot;UseCompoundDrawables&quot;&gt;

        &lt;LinearLayout
                android:layout_width=&quot;0dp&quot;
                android:layout_height=&quot;match_parent&quot;
                android:layout_weight=&quot;1&quot;
                android:orientation=&quot;vertical&quot;
                android:layout_gravity=&quot;center_vertical&quot;
                android:gravity=&quot;center_vertical&quot;&gt;

            &lt;TextView
                    android:id=&quot;@+id/wallpaper_name&quot;
                    android:layout_width=&quot;match_parent&quot;
                    android:layout_height=&quot;wrap_content&quot;
                    android:maxLines=&quot;1&quot;
                    android:ellipsize=&quot;end&quot;
                    android:textColor=&quot;@android:color/white&quot;
                    android:textAppearance=&quot;@style/TextAppearance.AppCompat.Medium&quot;
                    android:textSize=&quot;16sp&quot;
                    android:layout_gravity=&quot;center_vertical&quot;
                    android:gravity=&quot;center_vertical&quot;
                    tools:text=&quot;Wallpaper name&quot;/&gt;

            &lt;TextView
                    android:id=&quot;@+id/wallpaper_author&quot;
                    android:layout_width=&quot;match_parent&quot;
                    android:layout_height=&quot;wrap_content&quot;
                    android:layout_marginTop=&quot;4dp&quot;
                    android:maxLines=&quot;1&quot;
                    android:ellipsize=&quot;end&quot;
                    android:textColor=&quot;@android:color/white&quot;
                    android:textAppearance=&quot;@style/TextAppearance.AppCompat.Small&quot;
                    android:textSize=&quot;12sp&quot;
                    android:layout_gravity=&quot;center_vertical&quot;
                    android:gravity=&quot;center_vertical&quot;
                    tools:text=&quot;John Doe&quot;/&gt;

        &lt;/LinearLayout&gt;

        &lt;ImageView
                android:id=&quot;@+id/heart_icon&quot;
                android:layout_width=&quot;wrap_content&quot;
                android:layout_height=&quot;match_parent&quot;
                android:background=&quot;?selectableItemBackgroundBorderless&quot;
                android:visibility=&quot;gone&quot;
                android:layout_gravity=&quot;center&quot;
                android:gravity=&quot;center&quot;
                tools:ignore=&quot;ContentDescription&quot;/&gt;

    &lt;/LinearLayout&gt;

&lt;/FrameLayout&gt;"><pre class="notranslate">&lt;<span class="pl-ent">FrameLayout</span> <span class="pl-e">xmlns</span><span class="pl-e">:</span><span class="pl-e">android</span>=<span class="pl-s"><span class="pl-pds">"</span>http://schemas.android.com/apk/res/android<span class="pl-pds">"</span></span>
             <span class="pl-e">xmlns</span><span class="pl-e">:</span><span class="pl-e">tools</span>=<span class="pl-s"><span class="pl-pds">"</span>http://schemas.android.com/tools<span class="pl-pds">"</span></span>
             <span class="pl-e">xmlns</span><span class="pl-e">:</span><span class="pl-e">app</span>=<span class="pl-s"><span class="pl-pds">"</span>http://schemas.android.com/apk/res-auto<span class="pl-pds">"</span></span>
             <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_width</span>=<span class="pl-s"><span class="pl-pds">"</span>match_parent<span class="pl-pds">"</span></span>
             <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_height</span>=<span class="pl-s"><span class="pl-pds">"</span>wrap_content<span class="pl-pds">"</span></span>
             <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">orientation</span>=<span class="pl-s"><span class="pl-pds">"</span>vertical<span class="pl-pds">"</span></span>
             <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">foreground</span>=<span class="pl-s"><span class="pl-pds">"</span>?selectableItemBackground<span class="pl-pds">"</span></span>&gt;

    &lt;<span class="pl-ent">ImageView</span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>@+id/wallpaper_image<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_width</span>=<span class="pl-s"><span class="pl-pds">"</span>match_parent<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_height</span>=<span class="pl-s"><span class="pl-pds">"</span>wrap_content<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">scaleType</span>=<span class="pl-s"><span class="pl-pds">"</span>centerCrop<span class="pl-pds">"</span></span>
            <span class="pl-e">tools</span><span class="pl-e">:</span><span class="pl-e">ignore</span>=<span class="pl-s"><span class="pl-pds">"</span>ContentDescription<span class="pl-pds">"</span></span>/&gt;

    &lt;<span class="pl-ent">LinearLayout</span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>@+id/wallpaper_details<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">orientation</span>=<span class="pl-s"><span class="pl-pds">"</span>horizontal<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_width</span>=<span class="pl-s"><span class="pl-pds">"</span>match_parent<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_height</span>=<span class="pl-s"><span class="pl-pds">"</span>68dp<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">paddingStart</span>=<span class="pl-s"><span class="pl-pds">"</span>@dimen/fabs_margin<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">paddingLeft</span>=<span class="pl-s"><span class="pl-pds">"</span>@dimen/fabs_margin<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">paddingEnd</span>=<span class="pl-s"><span class="pl-pds">"</span>@dimen/fabs_margin<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">paddingRight</span>=<span class="pl-s"><span class="pl-pds">"</span>@dimen/fabs_margin<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_gravity</span>=<span class="pl-s"><span class="pl-pds">"</span>start|bottom<span class="pl-pds">"</span></span>
            <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">gravity</span>=<span class="pl-s"><span class="pl-pds">"</span>start|bottom<span class="pl-pds">"</span></span>
            <span class="pl-e">tools</span><span class="pl-e">:</span><span class="pl-e">ignore</span>=<span class="pl-s"><span class="pl-pds">"</span>UseCompoundDrawables<span class="pl-pds">"</span></span>&gt;

        &lt;<span class="pl-ent">LinearLayout</span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_width</span>=<span class="pl-s"><span class="pl-pds">"</span>0dp<span class="pl-pds">"</span></span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_height</span>=<span class="pl-s"><span class="pl-pds">"</span>match_parent<span class="pl-pds">"</span></span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_weight</span>=<span class="pl-s"><span class="pl-pds">"</span>1<span class="pl-pds">"</span></span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">orientation</span>=<span class="pl-s"><span class="pl-pds">"</span>vertical<span class="pl-pds">"</span></span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_gravity</span>=<span class="pl-s"><span class="pl-pds">"</span>center_vertical<span class="pl-pds">"</span></span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">gravity</span>=<span class="pl-s"><span class="pl-pds">"</span>center_vertical<span class="pl-pds">"</span></span>&gt;

            &lt;<span class="pl-ent">TextView</span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>@+id/wallpaper_name<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_width</span>=<span class="pl-s"><span class="pl-pds">"</span>match_parent<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_height</span>=<span class="pl-s"><span class="pl-pds">"</span>wrap_content<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">maxLines</span>=<span class="pl-s"><span class="pl-pds">"</span>1<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">ellipsize</span>=<span class="pl-s"><span class="pl-pds">"</span>end<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">textColor</span>=<span class="pl-s"><span class="pl-pds">"</span>@android:color/white<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">textAppearance</span>=<span class="pl-s"><span class="pl-pds">"</span>@style/TextAppearance.AppCompat.Medium<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">textSize</span>=<span class="pl-s"><span class="pl-pds">"</span>16sp<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_gravity</span>=<span class="pl-s"><span class="pl-pds">"</span>center_vertical<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">gravity</span>=<span class="pl-s"><span class="pl-pds">"</span>center_vertical<span class="pl-pds">"</span></span>
                    <span class="pl-e">tools</span><span class="pl-e">:</span><span class="pl-e">text</span>=<span class="pl-s"><span class="pl-pds">"</span>Wallpaper name<span class="pl-pds">"</span></span>/&gt;

            &lt;<span class="pl-ent">TextView</span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>@+id/wallpaper_author<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_width</span>=<span class="pl-s"><span class="pl-pds">"</span>match_parent<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_height</span>=<span class="pl-s"><span class="pl-pds">"</span>wrap_content<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_marginTop</span>=<span class="pl-s"><span class="pl-pds">"</span>4dp<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">maxLines</span>=<span class="pl-s"><span class="pl-pds">"</span>1<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">ellipsize</span>=<span class="pl-s"><span class="pl-pds">"</span>end<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">textColor</span>=<span class="pl-s"><span class="pl-pds">"</span>@android:color/white<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">textAppearance</span>=<span class="pl-s"><span class="pl-pds">"</span>@style/TextAppearance.AppCompat.Small<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">textSize</span>=<span class="pl-s"><span class="pl-pds">"</span>12sp<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_gravity</span>=<span class="pl-s"><span class="pl-pds">"</span>center_vertical<span class="pl-pds">"</span></span>
                    <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">gravity</span>=<span class="pl-s"><span class="pl-pds">"</span>center_vertical<span class="pl-pds">"</span></span>
                    <span class="pl-e">tools</span><span class="pl-e">:</span><span class="pl-e">text</span>=<span class="pl-s"><span class="pl-pds">"</span>John Doe<span class="pl-pds">"</span></span>/&gt;

        &lt;/<span class="pl-ent">LinearLayout</span>&gt;

        &lt;<span class="pl-ent">ImageView</span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>@+id/heart_icon<span class="pl-pds">"</span></span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_width</span>=<span class="pl-s"><span class="pl-pds">"</span>wrap_content<span class="pl-pds">"</span></span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_height</span>=<span class="pl-s"><span class="pl-pds">"</span>match_parent<span class="pl-pds">"</span></span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">background</span>=<span class="pl-s"><span class="pl-pds">"</span>?selectableItemBackgroundBorderless<span class="pl-pds">"</span></span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">visibility</span>=<span class="pl-s"><span class="pl-pds">"</span>gone<span class="pl-pds">"</span></span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">layout_gravity</span>=<span class="pl-s"><span class="pl-pds">"</span>center<span class="pl-pds">"</span></span>
                <span class="pl-e">android</span><span class="pl-e">:</span><span class="pl-e">gravity</span>=<span class="pl-s"><span class="pl-pds">"</span>center<span class="pl-pds">"</span></span>
                <span class="pl-e">tools</span><span class="pl-e">:</span><span class="pl-e">ignore</span>=<span class="pl-s"><span class="pl-pds">"</span>ContentDescription<span class="pl-pds">"</span></span>/&gt;

    &lt;/<span class="pl-ent">LinearLayout</span>&gt;

&lt;/<span class="pl-ent">FrameLayout</span>&gt;</pre></div>

<p dir="auto"><strong>Stack trace / LogCat</strong>:</p>
<div class="highlight highlight-source-ruby notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="E/AndroidRuntime: FATAL EXCEPTION: main
	Process: jahirfiquitiva.apps.test, PID: 13226
	java.util.ConcurrentModificationException
		at java.util.ArrayList$Itr.next(ArrayList.java:831)
		at com.bumptech.glide.request.target.ViewTarget$SizeDeterminer.notifyCbs(ViewTarget.java:180)
		at com.bumptech.glide.request.target.ViewTarget$SizeDeterminer.checkCurrentDimens(ViewTarget.java:197)
		at com.bumptech.glide.request.target.ViewTarget$SizeDeterminer$SizeDeterminerLayoutListener.onPreDraw(ViewTarget.java:310)
		at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
		at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2205)
		at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
		at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337)
		at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
		at android.view.Choreographer.doCallbacks(Choreographer.java:686)
		at android.view.Choreographer.doFrame(Choreographer.java:621)
		at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
		at android.os.Handler.handleCallback(Handler.java:751)
		at android.os.Handler.dispatchMessage(Handler.java:95)
		at android.os.Looper.loop(Looper.java:154)
		at android.app.ActivityThread.main(ActivityThread.java:6119)
		at java.lang.reflect.Method.invoke(Native Method)
		at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
		at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)"><pre class="notranslate"><span class="pl-c1">E</span>/<span class="pl-v">AndroidRuntime</span>: <span class="pl-c1">FATAL</span> <span class="pl-pds">EXCEPTION</span>: <span class="pl-en">main</span>
	<span class="pl-en">Process</span>: <span class="pl-en">jahirfiquitiva</span><span class="pl-kos">.</span><span class="pl-en">apps</span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">,</span> <span class="pl-pds">PID</span>: <span class="pl-c1">13226</span>
	<span class="pl-en">java</span><span class="pl-kos">.</span><span class="pl-en">util</span><span class="pl-kos">.</span><span class="pl-en">ConcurrentModificationException</span>
		<span class="pl-en">at</span> <span class="pl-en">java</span><span class="pl-kos">.</span><span class="pl-en">util</span><span class="pl-kos">.</span><span class="pl-en">ArrayList</span>$Itr<span class="pl-kos">.</span><span class="pl-en">next</span><span class="pl-kos">(</span><span class="pl-v">ArrayList</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:831</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">request</span><span class="pl-kos">.</span><span class="pl-en">target</span><span class="pl-kos">.</span><span class="pl-en">ViewTarget</span>$SizeDeterminer<span class="pl-kos">.</span><span class="pl-en">notifyCbs</span><span class="pl-kos">(</span><span class="pl-v">ViewTarget</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:180</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">request</span><span class="pl-kos">.</span><span class="pl-en">target</span><span class="pl-kos">.</span><span class="pl-en">ViewTarget</span>$SizeDeterminer<span class="pl-kos">.</span><span class="pl-en">checkCurrentDimens</span><span class="pl-kos">(</span><span class="pl-v">ViewTarget</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:197</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">request</span><span class="pl-kos">.</span><span class="pl-en">target</span><span class="pl-kos">.</span><span class="pl-en">ViewTarget</span>$SizeDeterminer$SizeDeterminerLayoutListener<span class="pl-kos">.</span><span class="pl-en">onPreDraw</span><span class="pl-kos">(</span><span class="pl-v">ViewTarget</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:310</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">view</span><span class="pl-kos">.</span><span class="pl-en">ViewTreeObserver</span><span class="pl-kos">.</span><span class="pl-en">dispatchOnPreDraw</span><span class="pl-kos">(</span><span class="pl-v">ViewTreeObserver</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:944</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">view</span><span class="pl-kos">.</span><span class="pl-en">ViewRootImpl</span><span class="pl-kos">.</span><span class="pl-en">performTraversals</span><span class="pl-kos">(</span><span class="pl-v">ViewRootImpl</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:2205</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">view</span><span class="pl-kos">.</span><span class="pl-en">ViewRootImpl</span><span class="pl-kos">.</span><span class="pl-en">doTraversal</span><span class="pl-kos">(</span><span class="pl-v">ViewRootImpl</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:1254</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">view</span><span class="pl-kos">.</span><span class="pl-en">ViewRootImpl</span>$TraversalRunnable<span class="pl-kos">.</span><span class="pl-en">run</span><span class="pl-kos">(</span><span class="pl-v">ViewRootImpl</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:6337</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">view</span><span class="pl-kos">.</span><span class="pl-en">Choreographer</span>$CallbackRecord<span class="pl-kos">.</span><span class="pl-en">run</span><span class="pl-kos">(</span><span class="pl-v">Choreographer</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:874</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">view</span><span class="pl-kos">.</span><span class="pl-en">Choreographer</span><span class="pl-kos">.</span><span class="pl-en">doCallbacks</span><span class="pl-kos">(</span><span class="pl-v">Choreographer</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:686</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">view</span><span class="pl-kos">.</span><span class="pl-en">Choreographer</span><span class="pl-kos">.</span><span class="pl-en">doFrame</span><span class="pl-kos">(</span><span class="pl-v">Choreographer</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:621</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">view</span><span class="pl-kos">.</span><span class="pl-en">Choreographer</span>$FrameDisplayEventReceiver<span class="pl-kos">.</span><span class="pl-en">run</span><span class="pl-kos">(</span><span class="pl-v">Choreographer</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:860</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">os</span><span class="pl-kos">.</span><span class="pl-en">Handler</span><span class="pl-kos">.</span><span class="pl-en">handleCallback</span><span class="pl-kos">(</span><span class="pl-v">Handler</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:751</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">os</span><span class="pl-kos">.</span><span class="pl-en">Handler</span><span class="pl-kos">.</span><span class="pl-en">dispatchMessage</span><span class="pl-kos">(</span><span class="pl-v">Handler</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:95</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">os</span><span class="pl-kos">.</span><span class="pl-en">Looper</span><span class="pl-kos">.</span><span class="pl-en">loop</span><span class="pl-kos">(</span><span class="pl-v">Looper</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:154</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">app</span><span class="pl-kos">.</span><span class="pl-en">ActivityThread</span><span class="pl-kos">.</span><span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-v">ActivityThread</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:6119</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">java</span><span class="pl-kos">.</span><span class="pl-en">lang</span><span class="pl-kos">.</span><span class="pl-en">reflect</span><span class="pl-kos">.</span><span class="pl-en">Method</span><span class="pl-kos">.</span><span class="pl-en">invoke</span><span class="pl-kos">(</span><span class="pl-en">Native</span> <span class="pl-v">Method</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">internal</span><span class="pl-kos">.</span><span class="pl-en">os</span><span class="pl-kos">.</span><span class="pl-en">ZygoteInit</span>$MethodAndArgsCaller<span class="pl-kos">.</span><span class="pl-en">run</span><span class="pl-kos">(</span><span class="pl-v">ZygoteInit</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:886</span><span class="pl-kos">)</span>
		<span class="pl-en">at</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">internal</span><span class="pl-kos">.</span><span class="pl-en">os</span><span class="pl-kos">.</span><span class="pl-en">ZygoteInit</span><span class="pl-kos">.</span><span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-v">ZygoteInit</span><span class="pl-kos">.</span><span class="pl-en">java</span><span class="pl-pds">:776</span><span class="pl-kos">)</span></pre></div>
<p dir="auto"><strong>Glide Version</strong>: 4.0.0</p>
<p dir="auto"><strong>Integration libraries</strong>: okhttp3-integration</p>

<p dir="auto"><strong>Device/Android Version</strong>: Galaxy Note 5 7.0/Nexus 6P 8.0</p>
<p dir="auto">In my app there is a list (RecyclerView) of images, which load through Glide. Some images are GIF, so for them I use static thumbnails. When I quickly scroll down and up the app crashes with following exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.blinkseven.jrviewer, PID: 18619
java.util.ConcurrentModificationException
    at java.util.ArrayList$Itr.next(ArrayList.java:831)
    at com.bumptech.glide.request.target.ViewTarget$SizeDeterminer.notifyCbs(ViewTarget.java:180)
    at com.bumptech.glide.request.target.ViewTarget$SizeDeterminer.checkCurrentDimens(ViewTarget.java:197)
    at com.bumptech.glide.request.target.ViewTarget$SizeDeterminer$SizeDeterminerLayoutListener.onPreDraw(ViewTarget.java:310)
    at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1013)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2513)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7098)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
    at android.view.Choreographer.doCallbacks(Choreographer.java:702)
    at android.view.Choreographer.doFrame(Choreographer.java:638)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6682)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)"><pre class="notranslate"><code class="notranslate">E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.blinkseven.jrviewer, PID: 18619
java.util.ConcurrentModificationException
    at java.util.ArrayList$Itr.next(ArrayList.java:831)
    at com.bumptech.glide.request.target.ViewTarget$SizeDeterminer.notifyCbs(ViewTarget.java:180)
    at com.bumptech.glide.request.target.ViewTarget$SizeDeterminer.checkCurrentDimens(ViewTarget.java:197)
    at com.bumptech.glide.request.target.ViewTarget$SizeDeterminer$SizeDeterminerLayoutListener.onPreDraw(ViewTarget.java:310)
    at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1013)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2513)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7098)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
    at android.view.Choreographer.doCallbacks(Choreographer.java:702)
    at android.view.Choreographer.doFrame(Choreographer.java:638)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6682)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
</code></pre></div>
<p dir="auto">I noticed that the app crashes only on items with GIFs and its thumbnails, namely when I include thumbnails loading.</p>

<p dir="auto">Here is an example of loading GIFs with Glide:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="RequestBuilder&lt;Drawable&gt; thumbnailRequest = GlideApp
                .with(this)
                .load(imageModel.getUri())
                .thumbnail(0.5f)
                .fallback(android.R.color.holo_orange_light)
                .placeholder(android.R.color.holo_green_light)
                .error(android.R.color.holo_red_light)
                .dontAnimate();

        GlideApp
                .with(this)
                .load(imageModel.getFullUri())
                .listener(listener)
                // Load gif's thumbnail through RequestBuilder
                .thumbnail(thumbnailRequest)
                .fallback(android.R.color.holo_orange_light)
                .placeholder(android.R.color.holo_green_light)
                .error(android.R.color.holo_red_light)
                .into((ImageView) findViewById(R.id.image));"><pre class="notranslate"><code class="notranslate">RequestBuilder&lt;Drawable&gt; thumbnailRequest = GlideApp
                .with(this)
                .load(imageModel.getUri())
                .thumbnail(0.5f)
                .fallback(android.R.color.holo_orange_light)
                .placeholder(android.R.color.holo_green_light)
                .error(android.R.color.holo_red_light)
                .dontAnimate();

        GlideApp
                .with(this)
                .load(imageModel.getFullUri())
                .listener(listener)
                // Load gif's thumbnail through RequestBuilder
                .thumbnail(thumbnailRequest)
                .fallback(android.R.color.holo_orange_light)
                .placeholder(android.R.color.holo_green_light)
                .error(android.R.color.holo_red_light)
                .into((ImageView) findViewById(R.id.image));
</code></pre></div>
<p dir="auto">If exclude 'thumbnail' option there is no exception.</p>