1

I magically encountered several errors at once as I opened my android project-

  1. Cannot resolve symbol 'R'
  2. Casting findViewById(R.id.buto) to Button is redundant

NOTE : I didn't had a single error in any of my files last time i closed it. Yes, I have seen several answers to this on StackOverflow.

What I did -:

  1. Rebuilded Project again
  2. I did => File> Invalidate Caches/Restart.
  3. Gradle Sync with project Files (it completed successfully with no errors)
  4. Restarted IntelliJ

I have repeated above steps 2-3 times but i am not able to solve the errors.

This is my build.gradle(app) file: build.gradle

8-Bit Borges
  • 9,643
  • 29
  • 101
  • 198
CUBE
  • 11
  • 3

1 Answers1

0

Clean your project and rebuild the project

pratham kesarkar
  • 3,770
  • 3
  • 19
  • 29
  • try removing R import and reimport using ALT+Enter – pratham kesarkar Jan 21 '18 at 06:23
  • I mentioned those in my question.... and i am also getting errors like Program execution -----> Process 'command 'C:\Users\(Username)\Appdata\Local\Android\sdk\build-tools\27.0.3\aapt.exe'' finished with non-zero exit value 1 – CUBE Jan 21 '18 at 06:25
  • take a look at this - ( this is one of my file) https://ibb.co/bQ8SPG (R is highlighted in red and Button, EditText etc are not highlighted i mean they are in grey color instead of white and they have a grey underline) – CUBE Jan 21 '18 at 06:33