5

I'm getting "Unresolved reference: R" build time error after updating android studio to chipmunk version in all "Direction" classes that are generated by navigation component. R class is not imported in that classes, though I can import it manually but classes will be regenerated without import in next build

android gradle plugin version = 7.2.0

gradle wrapper version = 7.3.3-all

any solutions?

  • 1
    Any updates on this? Seem to be related with removing package attribute from the manifest and moving it into build.gradle 'namespace' – sinek May 18 '22 at 09:35
  • 1
    @sinek I fixed this by rolling back all changes in the manifest and downgrading AGP to 7.1.2 – Mohsen Einhesari May 18 '22 at 09:41
  • An incompatible Gradle & AGP version aren't a "fix". Besides your issue isn't reproducible. – Martin Zeitler May 25 '22 at 15:08
  • 1
    I also reproduced the problem. I'm not resolved that by downgrade AGP to 7.1.2. but when add package attribute to AndroidManifest, I'm able to build my project. thank you @sinek – neske May 28 '22 at 14:24

1 Answers1

0

Had this same issue, I was able to fix it by updating this dependency in my Module build.grade

buildscript {    
dependencies {
        classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0-rc01")
    }
}

I also made sure my Android Gradle Plugin Version and Gradle Version were both set to the latest versions. (in the Project Structure->Project)