question

dansl avatar image
dansl asked dansl commented

Android Resource Missing?

Having a very strange issue, and it only happens when compiling for Production, and not for Development.

when I use this

mp = MediaPlayer.create(mContext, R.raw.ring);

It works 100% with my compiled Development APK and the sound plays... but after I compile it for Production and run it, i get the error "android.content.res.Resources$NotFoundException: File res/raw/ring.mp3 from drawable resource ID #0x7f050000"

Any ideas?

2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

paulbrendanconroy avatar image paulbrendanconroy commented ·

Hi, I am also facing this issue, did you manage to solve this? If so, can you please explain what you did? Thanks!

0 Likes 0 ·
dansl avatar image dansl paulbrendanconroy commented ·

Hey sorry for the late reply, but the only fix I found was to convert the audio file into a Base64 String, then load it as a url... Hacky, but it works.

String url = "data:audio/mp3;base64," + MyRing.Base64String;
mediaPlayer.setDataSource(url);
1 Like 1 ·

0 Answers

Welcome to the
Clover Developer Community