error: cannot find symbol Glide.with(this)
时间: 2023-09-04 17:16:40 浏览: 49
这个错误通常是因为你没有在代码中导入 Glide 库。如果你使用的是 Gradle 构建工具,可以在 `build.gradle` 文件中添加以下依赖:
```gradle
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
```
如果你已经添加了依赖,那么可能是因为你没有在代码中导入 Glide。可以在类的顶部添加以下导入语句:
```java
import com.bumptech.glide.Glide;
```
如果问题仍然存在,请确保你的项目中包含了正确的 Glide 依赖,并且在代码中正确地导入了 Glide。
相关问题
error: package com.bumptech.glide does not exist import com.bumptech.glide.Glide;
这个错误通常是因为项目中缺少 Glide 库的依赖。你需要在项目的 build.gradle 文件中添加 Glide 库的依赖,示例代码如下:
```groovy
dependencies {
implementation 'com.github.bumptech.glide:glide:4.12.0'
}
```
如果已经添加了依赖,你可以尝试重新构建项目或者清除构建缓存,以确保 Glide 库已经成功引入到项目中。
E/GlideExecutor: Request threw uncaught throwable com.bumptech.glide.Registry$NoModelLoaderAvailableException: Failed to find any ModelLoaders registered for model class: class com.chenying.life0603.fragment.Fragment_main1$1$1 at com.bumptech.glide.load.model.ModelLoaderRegistry.getModelLoaders(ModelLoaderRegistry.java:77) at com.bumptech.glide.Registry.getModelLoaders(Registry.java:594) at com.bumptech.glide.load.engine.DecodeHelper.getLoadData(DecodeHelper.java:212) at com.bumptech.glide.load.engine.DecodeHelper.getCacheKeys(DecodeHelper.java:229) at com.bumptech.glide.load.engine.ResourceCacheGenerator.startNext(ResourceCacheGenerator.java:47) at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311) at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:277) at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:424) at java.lang.Thread.run(Thread.java:764) at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultPriorityThreadFactory$1.run(GlideExecutor.java:383)
这个错误通常出现在使用 Glide 加载图片时,表示 Glide 没有找到适合指定 model(即图片地址)的 ModelLoader。通常这是因为你没有正确地配置 Glide 的 ModelLoader 或者你传入的 model 格式不被 Glide 支持。你可以尝试检查 Glide 的配置和传入的 model 格式,或者尝试使用其他支持该格式的库来加载图片。如果你能提供更多的上下文和细节,我可以帮你更详细地解决这个问题。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)