I was working on my project when suddenly the project showed an error in every java file where I used the find view by id method. Then it showed a Red line under "R". import R.java then again an error under layout id and layout name. I have created a new project but it still shows the same error in the main_Activity.java file. Please help me to resolve this problem.
Asked
Active
Viewed 71 times
-1
-
Please check that your .xml files have no errors. – galvan Jul 29 '15 at 08:21
-
This question has been asked a godzillion times. – Phantômaxx Jul 29 '15 at 08:22
-
xml file has no error. even when i create A new project then again same error. @galvan – Mubashar Jul 29 '15 at 08:33
-
in res in styles file showing error that theme.appcompat. error retreiving – Mubashar Jul 29 '15 at 10:10
2 Answers
1
You have not followed naming conventions properly for any view in xml files, layout file name, drawable name or same key in any values file. Whatever error is ... most likely its in res folder not in your code.
Even if it is not showing any error in res folder, it is still there !
Even if you can't solve the error, add your xml files , their names, drawable name, any one could else point out error for you.
Though it is just a small thing , I have seen 99% freshers stuck into it. By name of your class "main_Activity.java", you certainly not in remaining 1% !!
Follow naming conventions ALWAYS !
And here are godzillion answers ... R cannot be resolved - Android error

Community
- 1
- 1

Sourab Sharma
- 2,940
- 1
- 25
- 38
0
You haven't added in code so abstractly try these:
- Check
AndroidManifest.xml
for any errors. - Project - Clean - Clean Project.
- Add
appcompat_v7
library. This is an Android Support Library.

zackygaurav
- 4,369
- 5
- 26
- 40