2

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.

13
  • 1
    most probably network issue as not downloaded gradle
    – Basi
    Mar 18, 2019 at 11:02
  • try deleting the generated R.java file and again clean,bulid and rebuild
    – primo
    Mar 18, 2019 at 11:02
  • @Gaston Barbero have you try with new version 3.3.2? and try again Invalidate caches Mar 18, 2019 at 11:06
  • 3
    Have You updated to Android Studio 3.3.2 Mar 18, 2019 at 11:18
  • 1
    @VivekMakwana That actually fixed the issue. Thanks a lot! Mar 18, 2019 at 11:33

1 Answer 1

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.