java.io.IOException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • h5.Problem If you add a sound to a notification the sound is not found. http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Android.NotificationManager-module h5.Repro sequence {code:title=app.js} var win= Titanium.UI.createWindow(); var btn = Ti.UI.createButton({ title: 'Add Notification' }); btn.addEventListener('click', function(e) { var activity = Ti.Android.currentActivity(); var intent = Ti.Android.createIntent({ }); var pending = Ti.Android.createPendingIntent({ 'activity' : activity, 'intent' : intent, 'type' : Ti.Android.PENDING_INTENT_FOR_ACTIVITY, 'flags' : 1073741824 }); var ts = new Date().getTime(); var notification = Ti.Android.createNotification({ contentIntent : pending, contentTitle : 'Test', contentText : 'test', when : ts, //icon: 'KS_nav_ui.png',TIMOB-4651 sound: '1.mp3', defaults: Titanium.Android.NotificationManager.DEFAULT_VIBRATE }); Ti.Android.NotificationManager.notify(1, notification); }); win.add(btn); // testing if the image exist var lbl = Titanium.UI.createLabel({ text : ' ', backgroundImage: 'KS_nav_ui.png', top : 10, left: 10 }); win.add(lbl); win.open(); {code} h5.Console Output - With customized Sound Sound file is located at resources folder, so property is being set as: sound: '1.mp3' {noformat} I/StagefrightPlayer( 34): setDataSource('/android_asset/Resources/1.mp3') E/MediaPlayer( 60): error (1, -2147483648) W/NotificationService( 60): error loading sound for file:///android_asset/Resources/1.mp3 W/NotificationService( 60): java.io.IOException: Prepare failed.: status=0x1 W/NotificationService( 60): at android.media.MediaPlayer.prepare(Native Method) W/NotificationService( 60): at com.android.server.NotificationPlayer$CreationAndCompletionThread.run(NotificationPlayer.java:90) {noformat} h5.Tested on Device: HTC Dream Android 2.2 OS version & Emulator: Android HGVA h5.Associated HD ticket PRO - http://appc.me/c/APP-923324 h5.Additional info Get default vibrate by setting permissions in Tiapp.xml {noformat} <android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <uses-permission android:name="android.permission.VIBRATE"></uses-permission> </manifest> </android> {noformat} h5.Work Around To allow the app at this time to play the default sound and vibration as well: defaults: Titanium.Android.NotificationManager.DEFAULT_ALL To play default sound: defaults: Titanium.Android.NotificationManager.DEFAULT_SOUND To get phone vibration: defaults: Titanium.Android.NotificationManager.DEFAULT_VIBRATE
    via by Eduardo Gomez,
  • Code is not playing any audio
    via Stack Overflow by user2714061
    ,
  • android Stream WebRadio asx format
    via Stack Overflow by Gizo
    ,
  • Streaming .asx in Android
    via Stack Overflow by Jay Mayu
    ,
  • How to play video from URL?
    via Stack Overflow by coder_For_Life22
    ,
    • java.io.IOException: Prepare failed.: status=0x1 at android.media.MediaPlayer.prepare(Native Method) at com.android.server.NotificationPlayer$CreationAndCompletionThread.run(NotificationPlayer.java:90)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Indri Yunita
    2 times, last one,
    Adrien
    2 times, last one,
    5 more bugmates