Reputation: 395
I m a new developer in a android team. I clone the project. It works, i can compile it. But, my inspection code is red for resources files, despite R is valid and ok.
Exemple :
mRootView = inflater.inflate(R.layout.fragment_myobjects, container, false);
only fragment_myobjects is red. All layout, id, string, etc.. are red. But i can control + click on it and it find my files. So it s only the inspection who failed.
I have the problem and a friend too.
All this solution doesn't work:
Clean project
Rebuild
Invalid cache and restart
Nothing solve the problem
Upvotes: 1
Views: 98
Reputation: 13565
i have same problem for a while. after a lot of search and tries some thing work finally.
First i used AS 3.3.0 before and uninstall that and now use AS 3.1.1
Plan A
1) Go to File->Close Project
2) Click on Open an existing Android Studio project
3) find your project on import it
(don't ask me why!)
This is simply works for me after two day!
Upvotes: 0
Reputation: 2299
Please try this solution it might work..
1.Close project File -> Close
2.Welcome to Android studio screen will appear and in right side you will find your project list, so remove your project from list by pressing X icon.
3.Now close the android studio
4.Open My Computer and inside it go to the C:\Users\lenovo.AndroidStudio3.2 folder or whatever your android studio folder is and where it is installed.
5.Then you will find "System" folder go inside and after you will find "caches" folder again enter inside
6.Here you can find many files so select all and delete those filse
7.Close folder open android studio and select your project using "Open existing project"
Your error may be gone
Upvotes: 1
Reputation: 2476
If you can navigate to the file, then there is nothing wrong. Sometimes the Android Studio does that, but the build is successful.
It's either fixed by syncing with gradle or invalidating and restarting.
If not, make sure all the files are in the right places.
Upvotes: 1