Internal audio files must be placed in the assets dir

Anything libgdx related goes here!

Internal audio files must be placed in the assets dir

Postby SlowAR » Tue Sep 03, 2019 6:18 am

Hi!
I have many crashes with "Internal audio files must be placed in the assets directory" only on Samsung devices with only Android 6.0.1.
Exception text message:
Fatal Exception: com.badlogic.gdx.utils.GdxRuntimeException: Error loading audio file: sounds/music.mp3
Note: Internal audio files must be placed in the assets directory.
...
Caused by java.io.IOException: Prepare failed.: status=0x64
at android.media.MediaPlayer._prepare(MediaPlayer.java)
at android.media.MediaPlayer.prepare + 1173(MediaPlayer.java:1173)
at com.badlogic.gdx.backends.android.AndroidAudio.newMusic(AndroidAudio.java)

All my resources are placed in assets folder in Android project.
I load music like this:
Music music = Gdx.audio.newMusic(Gdx.files.internal("sounds/music.mp3"));

It works great, but wont on Samsung devices (Galaxy A5, Galaxy Tab A, Galaxy S5) with Android 6.0.1.
I tried to launch the game on emulator with Android 6.0 - it works, but Crashlytics sends me them each hour.
Thanks in advance for help!
SlowAR
 
Posts: 13
Joined: Tue Feb 26, 2019 8:37 am

Re: Internal audio files must be placed in the assets dir

Postby shatterblast » Tue Sep 03, 2019 4:09 pm

What version of LibGDX do you use? My first recommendation includes upgrading to the most recent version if you have not already. Also on occasion, it can become impossible to overcome that particular error with Google's crash detector in the Play Console, since their own software has bugs in that area once in a while.

By "Crashlytics", do you mean Firebase? ... Because I think only Firebase uses that name in its features.
shatterblast
 
Posts: 414
Joined: Sun Jul 06, 2014 1:14 pm

Re: Internal audio files must be placed in the assets dir

Postby SlowAR » Tue Sep 03, 2019 6:32 pm

I use gdxVersion '1.9.9'.
Yes, by Crashlytics I mean Firebase.
I have this exceptions only in Crashlytics, but they are not in Google's crash detector in the Play Console, it`s strange a little bit
SlowAR
 
Posts: 13
Joined: Tue Feb 26, 2019 8:37 am

Re: Internal audio files must be placed in the assets dir

Postby shatterblast » Tue Sep 03, 2019 7:02 pm

I first recommend updating to 1.9.10 to see if that fixes your issue.

I know you mention that this comes from "android/assets/", but does your game try to pull any music from Firebase?
shatterblast
 
Posts: 414
Joined: Sun Jul 06, 2014 1:14 pm

Re: Internal audio files must be placed in the assets dir

Postby SlowAR » Tue Sep 03, 2019 7:37 pm

No, game does not pull any files from firebase.
How can I properly update existing project to the lastest version of libgdx?
Thanks
SlowAR
 
Posts: 13
Joined: Tue Feb 26, 2019 8:37 am

Re: Internal audio files must be placed in the assets dir

Postby shatterblast » Tue Sep 03, 2019 7:54 pm

SlowAR wrote:I use gdxVersion '1.9.9'.

Set that to:

Code: Select all
gdxVersion '1.9.10'


You can find it in the build.gradle file of your project's root folder. After making the change, just "refresh" Gradle and let the stuff download. You will also need to Rebuild your project to properly test the results.
shatterblast
 
Posts: 414
Joined: Sun Jul 06, 2014 1:14 pm

Re: Internal audio files must be placed in the assets dir

Postby Magnesus » Wed Sep 04, 2019 6:24 am

Have you tried ogg instead of mp3? Maybe it is a codec problem?
Magnesus
 
Posts: 1698
Joined: Sun Sep 25, 2011 3:50 pm

Re: Internal audio files must be placed in the assets dir

Postby SlowAR » Wed Sep 04, 2019 9:14 am

I updated libgdx project and I will try to convert all sounds and music to ogg. I will answer here if it helps
SlowAR
 
Posts: 13
Joined: Tue Feb 26, 2019 8:37 am

Re: Internal audio files must be placed in the assets dir

Postby SlowAR » Fri Sep 06, 2019 8:55 am

After two days I do not recieve any crashes about it. I supose, that it was bad mp3 files, I converted them to ogg.
Thanks for help!
SlowAR
 
Posts: 13
Joined: Tue Feb 26, 2019 8:37 am


Return to Libgdx

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest