Issue 1:
Glide Version: 4.0.0-RC1

Integration libraries: okhttp3, recyclerview

Device/Android Version: Fails on One plus 3t, and Nexus 6p

Issue details / Repro steps / Use case background: Have a long list of items, scroll fast, when you rotate the screen (setRetainInstance(true)) the fragment stays in position. as soon as you then start to scroll this crash happens

Stack trace / LogCat:

java.lang.IllegalStateException: Failed to remove target from managers
at com.bumptech.glide.Glide.removeFromManagers(Glide.java:625)
at com.bumptech.glide.RequestManager.untrackOrDelegate(RequestManager.java:426)
at com.bumptech.glide.RequestManager.clear(RequestManager.java:412)
at com.bumptech.glide.RequestManager.clear(RequestManager.java:397)
at xxx.loadImage(ChatAdapter.java:162)
at xxx.onBindViewHolder(ChatAdapter.java:156)
at xxx.onBindViewHolder(ChatAdapter.java:111)
at xxx.onBindViewHolder(ChatAdapter.java:49)
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6507)
at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5450)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5716)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5555)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5551)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2211)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1538)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1498)
at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1312)
at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1057)
at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4836)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:886)
at android.view.Choreographer.doCallbacks(Choreographer.java:698)
at android.view.Choreographer.doFrame(Choreographer.java:630)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:872)
at android.os.Handler.handleCallback(Handler.java:769)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

Issue 2:
Glide Version: 3.7.0

Integration libraries: no

Device/Android Version: HUAWEI P7

Issue details / Repro steps / Use case background: Set a touch effect for ImageView

Glide load line / GlideModule (if any) / list Adapter code (if any):

class TestAdapter extends RecyclerView.Adapter<TestAdapter.TestViewHolder> {

private String[] imageUrls;
private Context mContext;

public TestAdapter(Context context, String[] imageUrls) {
this.mContext = context;
this.imageUrls = imageUrls;
}

@Override
public TestViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.
from(mContext).inflate(R.layout.item_recyclerview_history, parent, false);
TestActivity.TestAdapter.TestViewHolder holder = new TestActivity.TestAdapter.TestViewHolder(view);
holder.image.setRatio(1.5f);
return holder;
}

@Override
public void onBindViewHolder(TestViewHolder holder, int position) {

Glide.with(TestActivity.this).load(imageUrls[position]).
crossFade().placeholder(R.mipmap.pic_error).into(holder.image);
}

@Override
public int getItemCount() {
return imageUrls.length;
}

class TestViewHolder extends RecyclerView.ViewHolder {

RatioImageView image;

public TestViewHolder(View itemView) {
super(itemView);
image = (RatioImageView) itemView.findViewById(R.id.image);
}
}
}
// This is my RatioImageView .Actually it is from (https://github.com/HMY314/NineGridLayout/blob/master/app/src/main/java/com/hmy/ninegridlayout/view/RatioImageView.java)
public class RatioImageView extends ImageView {

private float mRatio = 0f;

public RatioImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}

public RatioImageView(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RatioImageView);

mRatio = typedArray.getFloat(R.styleable.RatioImageView_ratio, 0f);
typedArray.recycle();
}

public RatioImageView(Context context) {
super(context);
}

public void setRatio(float ratio) {
mRatio = ratio;
}

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = MeasureSpec.getSize(widthMeasureSpec);
if (mRatio != 0) {
float height = width / mRatio;
heightMeasureSpec = MeasureSpec.makeMeasureSpec((int) height, MeasureSpec.EXACTLY);
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}

@Override
public boolean onTouchEvent(MotionEvent event) {

switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
Drawable drawable = getDrawable();
if (drawable != null) {
drawable.mutate().setColorFilter(Color.GRAY,
PorterDuff.Mode.MULTIPLY);
}
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
Drawable drawableUp = getDrawable();
if (drawableUp != null) {
drawableUp.mutate().clearColorFilter();
}
break;
}

return super.onTouchEvent(event);
}
}

Layout XML:

<!--This is what my Item for RecyclerView looks like-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:padding="10dp"
android:layout_height="wrap_content">

<com.glidetest.view.RatioImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_gravity="center"
android:scaleType="fitXY"
android:layout_height="match_parent"
android:clickable="true"
android:src="@mipmap/pic_error"/>

</LinearLayout>

Stack trace / LogCat:

paste stack trace and/or log here

<br>

The original ImageView

<br>

When touch ImageView

<br>

Scroll the RecyclerView and scroll back, then touch the ImageView again, it disappears!!