<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="java.lang.NoClassDefFoundError: Failed resolution of: Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider"><pre class="notranslate"><code class="notranslate">java.lang.NoClassDefFoundError: Failed resolution of: Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider
</code></pre></div>
<p dir="auto">Guessing it's related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="293654465" data-permission-text="Title is private" data-url="https://github.com/bumptech/glide/issues/2863" data-hovercard-type="issue" data-hovercard-url="/bumptech/glide/issues/2863/hovercard" href="https://github.com/bumptech/glide/issues/2863">#2863</a>.</p>
<p dir="auto">I am using SimpleTarget to draw thing over downloaded images and then showing in ImageView.<br>
When i navigate from the activity and back and attempt to reload the images, the things that i drew previously are not cleared. I assume Glide is setting previous bitmap from memory. Is there a way to override it? Here is my code:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Target&lt;Bitmap&gt; target = new SimpleTarget&lt;Bitmap&gt;() {
    @Override
    public void onResourceReady(Bitmap resource, GlideAnimation&lt;? super Bitmap&gt; glideAnimation) {
        if (notWatched) {
            Canvas canvas = new Canvas(resource);
            Paint paint = new Paint();

            paint.setColor(ivImage.getResources().getColor(R.color.blue));
            paint.setStyle(Paint.Style.FILL);
            paint.setAntiAlias(true);

            int triangleSide = canvas.getHeight() / 5;
            Point a = new Point(canvas.getWidth(), 0);
            Point b = new Point(canvas.getWidth(), triangleSide);
            Point c = new Point(canvas.getWidth() - triangleSide, 0);

            Path path = new Path();
            path.setFillType(Path.FillType.EVEN_ODD);
            path.moveTo(a.x, a.y);
            path.lineTo(b.x, b.y);
            path.lineTo(c.x, c.y);
            path.lineTo(a.x, a.y);
            path.close();

            canvas.drawPath(path, paint);
        }
      ivImage.setImageBitmap(resource);
    }
};
Glide.with(this).load(imageUrl).asBitmap().centerCrop().into(target);
"><pre class="notranslate"><span class="pl-smi">Target</span>&lt;<span class="pl-smi">Bitmap</span>&gt; <span class="pl-s1">target</span> = <span class="pl-k">new</span> <span class="pl-smi">SimpleTarget</span>&lt;<span class="pl-smi">Bitmap</span>&gt;() {
    <span class="pl-c1">@</span><span class="pl-c1">Override</span>
    <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-en">onResourceReady</span>(<span class="pl-smi">Bitmap</span> <span class="pl-s1">resource</span>, <span class="pl-smi">GlideAnimation</span>&lt;? <span class="pl-en">super</span> <span class="pl-smi">Bitmap</span>&gt; <span class="pl-s1">glideAnimation</span>) {
        <span class="pl-k">if</span> (<span class="pl-s1">notWatched</span>) {
            <span class="pl-smi">Canvas</span> <span class="pl-s1">canvas</span> = <span class="pl-k">new</span> <span class="pl-smi">Canvas</span>(<span class="pl-s1">resource</span>);
            <span class="pl-smi">Paint</span> <span class="pl-s1">paint</span> = <span class="pl-k">new</span> <span class="pl-smi">Paint</span>();

            <span class="pl-s1">paint</span>.<span class="pl-en">setColor</span>(<span class="pl-s1">ivImage</span>.<span class="pl-en">getResources</span>().<span class="pl-en">getColor</span>(<span class="pl-smi">R</span>.<span class="pl-s1">color</span>.<span class="pl-s1">blue</span>));
            <span class="pl-s1">paint</span>.<span class="pl-en">setStyle</span>(<span class="pl-smi">Paint</span>.<span class="pl-s1">Style</span>.<span class="pl-c1">FILL</span>);
            <span class="pl-s1">paint</span>.<span class="pl-en">setAntiAlias</span>(<span class="pl-c1">true</span>);

            <span class="pl-smi">int</span> <span class="pl-s1">triangleSide</span> = <span class="pl-s1">canvas</span>.<span class="pl-en">getHeight</span>() / <span class="pl-c1">5</span>;
            <span class="pl-smi">Point</span> <span class="pl-s1">a</span> = <span class="pl-k">new</span> <span class="pl-smi">Point</span>(<span class="pl-s1">canvas</span>.<span class="pl-en">getWidth</span>(), <span class="pl-c1">0</span>);
            <span class="pl-smi">Point</span> <span class="pl-s1">b</span> = <span class="pl-k">new</span> <span class="pl-smi">Point</span>(<span class="pl-s1">canvas</span>.<span class="pl-en">getWidth</span>(), <span class="pl-s1">triangleSide</span>);
            <span class="pl-smi">Point</span> <span class="pl-s1">c</span> = <span class="pl-k">new</span> <span class="pl-smi">Point</span>(<span class="pl-s1">canvas</span>.<span class="pl-en">getWidth</span>() - <span class="pl-s1">triangleSide</span>, <span class="pl-c1">0</span>);

            <span class="pl-smi">Path</span> <span class="pl-s1">path</span> = <span class="pl-k">new</span> <span class="pl-smi">Path</span>();
            <span class="pl-s1">path</span>.<span class="pl-en">setFillType</span>(<span class="pl-smi">Path</span>.<span class="pl-s1">FillType</span>.<span class="pl-c1">EVEN_ODD</span>);
            <span class="pl-s1">path</span>.<span class="pl-en">moveTo</span>(<span class="pl-s1">a</span>.<span class="pl-s1">x</span>, <span class="pl-s1">a</span>.<span class="pl-s1">y</span>);
            <span class="pl-s1">path</span>.<span class="pl-en">lineTo</span>(<span class="pl-s1">b</span>.<span class="pl-s1">x</span>, <span class="pl-s1">b</span>.<span class="pl-s1">y</span>);
            <span class="pl-s1">path</span>.<span class="pl-en">lineTo</span>(<span class="pl-s1">c</span>.<span class="pl-s1">x</span>, <span class="pl-s1">c</span>.<span class="pl-s1">y</span>);
            <span class="pl-s1">path</span>.<span class="pl-en">lineTo</span>(<span class="pl-s1">a</span>.<span class="pl-s1">x</span>, <span class="pl-s1">a</span>.<span class="pl-s1">y</span>);
            <span class="pl-s1">path</span>.<span class="pl-en">close</span>();

            <span class="pl-s1">canvas</span>.<span class="pl-en">drawPath</span>(<span class="pl-s1">path</span>, <span class="pl-s1">paint</span>);
        }
      <span class="pl-s1">ivImage</span>.<span class="pl-en">setImageBitmap</span>(<span class="pl-s1">resource</span>);
    }
};
<span class="pl-smi">Glide</span>.<span class="pl-en">with</span>(<span class="pl-smi">this</span>).<span class="pl-en">load</span>(<span class="pl-s1">imageUrl</span>).<span class="pl-en">asBitmap</span>().<span class="pl-en">centerCrop</span>().<span class="pl-en">into</span>(<span class="pl-s1">target</span>);</pre></div>