I have downloaded a background music and put it on a raw file, but Android Studio won't see it. I pressed something wrong and now raw is now seen as a Java class, but still, my mp3 file can't be seen. Any ideas?
Asked
Active
Viewed 128 times
0
-
try to rebuild and clean project – MJM Jul 22 '18 at 04:35
-
How can I do this ? – user9409795 Jul 22 '18 at 04:36
-
It's just `R.raw.sound`... You don't need the extension – OneCricketeer Jul 22 '18 at 04:37
-
Remove the `.mp3` part from the parameter – Jibran Khan Jul 22 '18 at 04:38
-
It still appears with red color – user9409795 Jul 22 '18 at 04:40
-
Well, that's correct, so you have some other problem with your resources - Also https://stackoverflow.com/questions/4162230/how-do-i-play-an-mp3-in-the-res-raw-folder-of-my-android-app – OneCricketeer Jul 22 '18 at 04:42
-
@cricket_007 Already tried this, but unsuccessfully. Maybe rebuilding and clean project will work ? – user9409795 Jul 22 '18 at 04:49
-
Not unless some other XML file, for example, has an error... You need to try and compile your code and look at the errors – OneCricketeer Jul 22 '18 at 04:51
-
@cricket_007 I solved the error, but the mp3 don't start when I start the application. How should I save the mp3? I just copy and pasted into the raw folder. – user9409795 Jul 22 '18 at 05:08
-
That's the only way I know how to save mp3 into the project – OneCricketeer Jul 22 '18 at 05:09