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:
- Solve the error when installing apk after compiling Android Studio: Error while Installing APK
- no target device found problem solved
- Solve gradle project refresh failed
- How to Fix Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!
- Failed to resolve: com.android.support:appcompat-v7:27.
- Failed to find Build Tools revision 27.0.3
- g++: internal compiler error: Killed (program cc1plus)
- Session ‘app’: Error Installing APKs
- AndroidStudio sync failed solution
- android studio Error Gradle project sync failed. Please fix your project and try again
- Su prompt when switching users: resource temporarily unavailable
- An error is reported when starting the Android emulator: Emulator: audio: Failed to create voice `goldfish_audio_in’
- node.js Error: write epipe problem solved!
- To change the theme and font of your pychar
- Solution to CUDA installation failure problem visual studio integration failed
- Item exception: failed to get the required ADT version number from the SDK
- The solution of “failed to load il2cpp” in Android package launched by unity
- Problems encountered by Android Studio: Session’app’: Error Installing APKs
- Failed to find target with hash string ‘android-25’ in:D:\SDK