I\'m trying to create a raw folder for my android app which will hold different media files for use later. But I can\'t seem to be able to reference the created raw folder i
Another answer on Stack Overflow helped with this. You can just go to Build > Clean Project and that will automatically resolve your issue.
The raw folder must be inside the res folder, otherwise it won't work.
General folder will get error if you create and put some file into it. Put some media file into raw folder then you can able to refer the raw folder into your .java files.
Hope it will clear all your doubts.
You also need to follow the naming convention while putting any media file in raw folder as well. In my case my file name was not correct and it was also prompting me an error that unable to find R file. But as @Kesha said it build successfully while it was prompting me an error as well
Just create 'raw' inside 'res' folder and place media file inside that raw folder. Then try to access that media file through your program like R.raw.mediaFile
When I created raw folder inside res for the first time, I was not able to access it using R.raw but still I use R.raw.music
in my code [showing me error that can not reference to this folder] and when deploy the app that error gone away, my app run without any problem. After that, I was able to access raw folder using R.raw
.