Android 工作室代码显示为红色。但是运行成功
Android studio codes are showing red color. But it runs successfully
我项目中的所有代码都是红色的。但我可以 运行 我的项目成功。我更新了安卓
工作室以及我清理,重建项目。错误仍然存在。谁能帮忙
解决这个问题。
Solution 1:
尝试同步 gradle
File -> Sync Project With gradle Files
如果不起作用,请按照解决方案 2。
Solution 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')
......
......
}
有一天我遇到了同样的问题,我用第二招解决了它们..
我项目中的所有代码都是红色的。但我可以 运行 我的项目成功。我更新了安卓 工作室以及我清理,重建项目。错误仍然存在。谁能帮忙 解决这个问题。
Solution 1:
尝试同步 gradle
File -> Sync Project With gradle Files
如果不起作用,请按照解决方案 2。
Solution 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')
......
......
}
有一天我遇到了同样的问题,我用第二招解决了它们..