Error when updating to Gradle 3.3.2 in Android Stu

2019-07-10 04:09发布

If I update Gradle by changing

dependencies {
    classpath 'com.android.tools.build:gradle:3.x.x'
}

from version 3.2.1 to version 3.3.2 I get the Cannot resolve symbol R error on all activities but the project actually builds without errors. Don't know what might be causing this. I realized on the Android view of the project files, under app/generatedJava/ there are many packages with version 3.2.1, but when updated none of them are there, except for a BuildConfig.java class under my.app.package.

I've already tried all the Build -> Clean, Build -> Rebuild, File -> Invalidate caches, File -> Sync Project with Gradle Files, etc. methods which would solve the problem and still not finding the R class.

With version 3.2.1 this doesn't happen though.

1条回答
Anthone
2楼-- · 2019-07-10 04:43

As Vivek stated in the comments, the solution is to upgrade Android Studio as well. I upgraded to version 3.3 and it finally solved the problem for me.

查看更多
登录 后发表回答