The reason of error in R file

1. Introduction
General R file error, nothing more than resource file error, picture naming error, but compilation will report error, can be quickly solved. However, a few days ago, after introducing a third-party AAR package, the project compiled correctly, but the R file failed to find the R file, and the whole project was in the red.
2. Wrong approach

Clean Project
Rebuild Project

I’m sure a lot of people, the first reaction is these two versions, but after trying both, found that still report errors. I closed the studio and reopened it several times, even rebooted the computer…
3. Solution
1) The R file should be generated, but it cannot be referenced. Then we go to the R file and open it.
When you open the R file, you find a line at the top of the R file, as shown in the figure below:

The IDE limits the size of files that can be associated, mainly to protect memory. The default value is 2500KB. Find the problem, and let’s fix it.
2) choose Android Studio under the Help menu of the Edit the Custom Properties, in the file to add: idea. Max. Intellisense. Filesize = 5000, and then restart the Android Studio. As shown in the figure:


After you restart Android Studio, everything should be fine.
 


If you have any mistakes, please point out and learn together.

Read More: