Divya Puri
Divya Puri

Reputation: 31

raw folder is not recognized even though it has been created in the "res" folder

http://img819.imageshack.us/img819/7111/hlgy.png

If I hover over the raw folder it says

"raw cannot be resolved or is not a field"

Upvotes: 3

Views: 7630

Answers (5)

Rumit Patel
Rumit Patel

Reputation: 12469

In my case, the R was not imported properly.

Remove import android.R and import proper R.

Upvotes: 0

İlimsel Yardım
İlimsel Yardım

Reputation: 1

I put a music file in the raw folder in type ".m4a" and it worked for me

Upvotes: 0

Nitro
Nitro

Reputation: 1093

I had the same issue today. Restarting android studio work for me.

Upvotes: 2

Sharp Edge
Sharp Edge

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

  1. clean your Project ( go to "project" menu and select clean)
  2. Invalidate Caches /Restart Android Studio

Hope this helps :)

Upvotes: 9

codeMagic
codeMagic

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

Related Questions