最近经常遇到R文件报红,不论是sync、clean、rebuild都不能解决问题。虽然能编译运行,但是看着一片报红心里还是很不爽。
上网查了资料后发现,Android studio版本跟gradle版本不一致会导致报红。我目前用的是3.2版本,但是gradle用的是3.3.1版本,修改为3.2.1之后,报红问题解决。小问题权当记录
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.tencent.bugly:symtabfileuploader:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}