Glid4 - BitmapImageViewTarget at into 方法

Glid4 - BitmapImageViewTarget at into method

今天我试图在我的 android 应用程序中使用 Glide4 图像加载器,同时使用它时我遇到了无法解决问题的方法。我搜索了很多,也找到了解决方案,我必须创建 RequestOptions 并像这样使用:

private void loadImages() {
    RequestOptions requestOptions = new RequestOptions();
    requestOptions.placeholder(R.drawable.circle_diff);
    requestOptions.centerCrop();
    Glide.with(this)
            .load("http://localhost/ImageRepo/profile.jpg")
            .apply(requestOptions)
    .into(new BitmapImageViewTarget(mBinding.profilePic){
        @Override
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable =
                    RoundedBitmapDrawableFactory.create(getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            mBinding.profilePic.setImageDrawable(circularBitmapDrawable);
        }
    });

但是在 .into 方法中我遇到了 Cannot resolve method 'into(anonymous com.bumptech.glide.request.target.BitmapImageViewTarget) 错误。发生什么事了??

我的应用gradle 依赖项:

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation("com.github.bumptech.glide:glide:4.6.1") {
        exclude group: "com.android.support"
    }
    implementation "com.android.support:support-fragment:26.1.0"

    annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
}

试试这个 使用 requestOptions.circleCropTransform();

    RequestOptions requestOptions = new RequestOptions();                    
    requestOptions.placeholder(R.drawable.ic_launcher_background);           
    requestOptions.circleCropTransform();                                    
    requestOptions.transforms( new RoundedCorners(300));                     

     Glide.with(this)                                                        
          .load("https://i.stack.imgur.com/7CChZ.jpg?s=328&g=1")             
          .apply(requestOptions)                                             
          .into(imageView);        

输出