Reputation: 31
If I hover over the raw folder it says
"raw cannot be resolved or is not a field"
Upvotes: 3
Views: 7630
Reputation: 12469
In my case, the R was not imported properly.
Remove import android.R
and import proper R.
Upvotes: 0
Reputation: 1
I put a music file in the raw folder in type ".m4a" and it worked for me
Upvotes: 0
Reputation: 4192
Well if its just a warning and everything seems to be working, then ignore it
If you can't read the values/data in Raw folder
then 2 options
- clean your Project ( go to "project" menu and select clean)
- Invalidate Caches /Restart Android Studio
Hope this helps :)
Upvotes: 9
Reputation: 44571
Try cleaning your project
Project --> Clean... then pick your project
Sometimes Eclipse doesn't pick up xml or resource changes right away so it throws these class cast exceptions. Simply cleaning and rebuilding the project usually takes care of such errors. Its a quick and easy thing to do before pulling out all of your hair trying to figure out why you would get such an exception.
Upvotes: 2