The file is not associated with any file type. Please define an association

I have an audio file with the extension .mp3, I wanted to add it to the "raw" folder in Android studio in order to access it from my java file, for example:

Intent objIntent = new Intent(this, PlayAudio.class); 

I see a question mark in my sound file in an unprocessed folder, and whenever I click on it, it shows me a screen with this message:

The file "xy.mp3" is not associated with any file type. Please define an association

Any suggestion?

+6
source share
4 answers

I also had this the other day, trying to figure out what type of file can be linked. Then I just realized that the file name of your .mp3 should be lowercase. AS cannot recognize files with capital letters in the file name, I changed it and it works fine. Not sure if this is your case either.

+5
source

The problem was that I was dragging and dropping the .mp3 file into the raw folder in Android Studio, since I did it in Eclips, but in Eclips I did not encounter such a problem. So what I did:

I opened the project folder:

C: \ Users \ hoh \ AndroidStudioProjects \ PlayAudio \ application \ SRC \ main \ Res \ raw

and past my .mp3 file in the raw folder, and now I do not see any question marks in my sound file in the source folder

+2
source

The window that appears there asking for the type is that Android Studio does not know how to open the file so that you can visualize / listen to the file. This does not affect how the file is processed by android at all.

Since Android Studio does not have a media player, I suggest you select Open matching files in related application. This will launch your default music player and play this mp3.

+1
source

It just means that the Android studio does not know what this file is (for obvious reasons, since it does not contain a music player / editor). You should still have access to this file as any raw resource.

0
source

Source: https://habr.com/ru/post/979999/


All Articles