ant*_*ony 10 android android-studio android-glide
上周我将Android Studio从2.x更新到3.x. 项目迁移是完美的,构建很棒.现在,从2个小时开始,我无法解释为什么,我无法构建,我现在在Glide上有这个错误:
错误:(26,22)错误:找不到符号类GlideApp
之前一切都很好,我没有改变任何东西(gradle或配置),现在出现这个错误......
有关Glide的信息,请参阅我的Gradle:
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
compile 'com.github.bumptech.glide:okhttp3-integration:4.0.0-RC1'
Run Code Online (Sandbox Code Playgroud)
GlideApp文件自动生成(我检查过).
所以,这是一个疯狂的情况.非常感谢你们!
Zoe*_*Zoe 10
其中一些情况往往会不时弹出(对于生成类的实例,R最终没有生成).我过去解决这个问题的最简单方法是清理项目并重建它.如果这不起作用,请按File顶部菜单并按"无效缓存并重新启动".将出现第二个弹出窗口,按"无效缓存并重新启动".Android Studio需要重新索引和重建项目可能需要一段时间,但它解决了我遇到的大多数问题.
同样的事情发生在我身上,这是我有过的最奇怪的错误之一,我在项目中使用了Butterknife,发现如果您以私有模式定义视图,则会出现此错误
使用:
@BindView(R.id.tv_option_one)
TextView tv_option_one;
@BindView(R.id.tv_option_two)
TextView tv_option_two;
Run Code Online (Sandbox Code Playgroud)
代替
@BindView(R.id.tv_option_one)
private TextView tv_option_one;
@BindView(R.id.tv_option_two)
private TextView tv_option_two;
Run Code Online (Sandbox Code Playgroud)
当您使用bindView或onClick批注时,在Butterknife中找不到视图时,通常会发生这种情况,最糟糕的部分是它在所有错误中都会显示错误,除了应该在的位置。
当我迁移到 AndroidX 时遇到了同样的问题。我最终通过添加/更新依赖项来解决它
implementation 'com.github.bumptech.glide:glide:4.8.0-SNAPSHOT'
kapt 'com.github.bumptech.glide:compiler:4.8.0-SNAPSHOT'
kapt 'androidx.annotation:annotation:1.0.0-rc01'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9319 次 |
| 最近记录: |