我的项目中的所有代码均为红色。但是我可以成功运行我的项目。我更新了andriod 工作室以及我打扫,重建项目。错误仍然存在。谁能帮忙 解决这个问题。
答案 0 :(得分:0)
解决方案1:
尝试同步gradle
File -> Sync Project With gradle Files
如果不起作用,请遵循解决方案2。
解决方案2:
只需删除dependencies{}
部分中的依赖项并进行同步
然后返回所有依赖项并进行同步
第1步
//1. Remove all dependencies
//2. Sync
dependencies {
}
第2步
//1. back to all dependencies (Re-Add)
//2. Sync
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
......
......
}
有一天,我遇到了同样的问题,并且通过第二招解决了它们。