微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android studio:找不到符号类GlideDrawable

每当我尝试编译它时,我遇到这个项目的问题就会显示错误

Error: cannot find symbol class GlideDrawable

请看看app:module

dependencies {
  compile filetree(dir: 'libs',include: ['*.jar'])
  androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1',{
    exclude group: 'com.android.support',module: 'support-annotations'
  })
  compile 'com.android.support:appcompat-v7:27.0.2'
  compile 'com.android.support:cardview-v7:27.0.2'
  compile 'com.android.support:appcompat-v7:27.0.2'
  compile 'com.android.support:design:27.0.2'
  compile project(':SubProjects:lib_sound_crop')
  compile project(':SubProjects:libraryColorPickrBest')
  compile project(':SubProjects:library_gellaryfinal')
  compile 'com.android.support:multidex:1.0.2'
  implementation 'com.github.bumptech.glide:glide:4.6.0'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.6.0'
  compile 'jp.wasabeef:glide-transformations:2.0.1'
  compile 'com.google.firebase:firebase-messaging:11.8.0'
  compile 'com.google.firebase:firebase-ads:11.8.0'
  compile 'com.google.firebase:firebase-core:11.8.0'
  testCompile 'junit:junit:4.12'

和项目建设

buildscript {
  repositories {
    mavenCentral()
    google()
    jcenter()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
    classpath 'com.google.gms:google-services:3.1.1'
  }

提前致谢

解决方法

GlideDrawable在4.x版本中折旧,因此如果您从3.x移动到4.x,则使用Drawable.

例如,如果您在代码中的某处使用侦听器,那么请转到简单的此方法.

.listener(new RequestListener<Drawable>() {
                @Override
                public boolean onLoadFailed(@Nullable GlideException e,Object model,Target<Drawable> target,boolean isFirstResource) {
                    progressBar.setVisibility(View.GONE);
                    return false;
                }

                @Override
                public boolean onResourceReady(Drawable resource,DataSource dataSource,boolean isFirstResource) {
                    progressBar.setVisibility(View.GONE);
                    return false;
                }
            })

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐