Android Studio - 无法解析符号 'Glide'

Android Studio - cannot resolve symbol 'Glide'

我正在尝试在 Android Studio 中使用 glide 来处理存储在 R.drawable 中的资源中的 Gif 动画,但我得到 "cannot resolve sysmbol 'Glide'".

我在 builde.gradle

中的依赖项中添加了 glide
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.2.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'
}

我正在使用以下代码将图像视图设置为 gif。

ImageView img=(ImageView)findViewById(R.id.catImg);
int resourceId = R.drawable.gangrycat;
Glide.with(this.context)
     .load(resourceId)
     .into(img);

我已经设法解决了我的问题,但我觉得有点愚蠢。

忘记下载glide库并导入了

可以找到完整的说明here

我通过从 builde.gradle 中删除依赖项并同步我的项目解决了这个问题,然后再次将 glide 依赖项添加到项目 builde.gradle 并再次同步。

我也通过删除依赖项解决了这个问题,然后再次将 glide 依赖项添加到项目 builde.gradle 并再次同步