Android: How to add R.raw to project?

Solution 1:

Adding a raw folder to your resource folder (/res/) should do the trick.

Read more here: https://developer.android.com/guide/topics/resources/providing-resources.html

Solution 2:

enter image description hereRight click on package or Res folder click on new on popup then click on android resource directory

a new window will be appear change the resource type to raw and hit OK copy and past song to raw folder remember don't drag and drop song file to raw folder and song spell should be in lower case! This method is for Android Studio Also Check MY Link

Solution 3:

If you have a res/raw folder, be sure to add a file with a valid filename, otherwise the entire folder won't show up in the R class. If there's an error with a filename, it will appear in red in the console.

Solution 4:

Simply add a folder 'raw' to your res folder.