Strange resource not found issue?

Posted by xBroak on Stack Overflow See other posts from Stack Overflow or by xBroak
Published on 2012-11-17T22:56:26Z Indexed on 2012/11/17 22:59 UTC
Read the original article Hit count: 288

Filed under:
|
|

i seem to be having a very strange problem, when the app is run on my test phone it works perfectly, and plays a sound from the raw folder via soundpool on button press, however when i submit my app to testing after building it it crashes on 120+ devices for 'Resource not found'

codes below: Please also note, the file is in fact there, in both the R file, in the compiled APK file and i have also cleaned numerous times.

http://www.appthwack.com/public/FUVGFZn42q

'01-03 21:09:36.828 26762 26762 W System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{appinventor.ai_Broak.PaintballWiz/com.muo.paintballwiz.PaintballWiz}: android.content.res.Resources$NotFoundException: File res/raw/pballshot.ogg from drawable resource ID #0x7f050000 - 1 occurrence'



soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 100);
                        //soundPoolMap = new SparseIntArray();
                        soundPoolMap = new HashMap<Integer, Integer>();
                        // soundPoolMap.put(soundID, soundPool.load(this, R.raw.midi_sound, 1));
                        int myAudioFile = getResId("pballshot", R.raw.class);
                        soundPoolMap.put(soundID, soundPool.load(PaintballWiz.this, myAudioFile, 1));
                        audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
                        curVolume = audioManager
                                .getStreamVolume(AudioManager.STREAM_MUSIC);
                        maxVolume = audioManager
                                .getStreamMaxVolume(AudioManager.STREAM_MUSIC);
                        leftVolume = curVolume / maxVolume;
                        rightVolume = curVolume / maxVolume;
                        soundPool.play(soundID, leftVolume, rightVolume, priority,
                                no_loop, normal_playback_rate);
                        soundPool.play(soundID, 0, 0, 1, -1, 1f);

© Stack Overflow or respective owner

Related posts about android

Related posts about resources