3

I am trying to add sounds to my project, but android studio does not recognize these files. The file has a question mark icon before it and if i play the project, the following screen appears:

enter image description here

any way to solve this?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Kees Til
  • 171
  • 1
  • 17

4 Answers4

0

Select the 'Archive' option and be sure the syntax of the filename is right (only lowercase a-z, 0-9, or underscore).

acimutal
  • 2,155
  • 2
  • 17
  • 22
0

Any file added to the raw folder will have a '?' over it, although that doesn't mean Android Studio doesn't recognize the file.

If you need to open the file after importing it into Android Studio, select 'groovy' in the 'Register New File Type Association' window that pops up, and make sure that the 'Open matching files in associated application' option is selected before pressing 'OK.' This will cause Window's Groovy application to open your mp3 file when you select it.

If you accidentally select an option other than groovy, or forget to choose the '...associated application' option, you can undo your action by going File -> Settings -> "associate" -> File Types -> (the file type you selected) -> .mp3 -> '-' -> OK Like This

Later, when you call R.raw.soundFile Android Studio should recognize it.

Hope this helps.

JustAnotherGuy
  • 259
  • 3
  • 14
0

Screenshot MP3 files not recognizing in Android Studio.

  • Name should be lowercased so rename audio file name i.e. Zingaat.mp3 to zin_gaat.mp3
  • Remove .mp3 extension from the file.
Aniruddh Parihar
  • 3,072
  • 3
  • 21
  • 39
-2

Choose "open matching files in associated application" and don't worry about the question mark besides the name of your sound.

Amir
  • 1