Android Question Need help for error message

kohle

Active Member
Licensed User
Hi,
I get following error (release mode) with B4A 5 :

I didnt had this with the previous B4A version, but I am not sure if it is depending on the version.


java.io.IOException: Prepare failed.: status=0x80000000
at android.media.MediaPlayer._prepare(Native Method)
at android.media.MediaPlayer.prepare(MediaPlayer.java:1125)
at anywheresoftware.b4a.objects.MediaPlayerWrapper.loadAfterReset(MediaPlayerWrapper.java:97)
at anywheresoftware.b4a.objects.MediaPlayerWrapper.Load(MediaPlayerWrapper.java:62)
at JK.VigiTrackMobile.jk_class._pev_smssentstatus(jk_class.java:890)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.phone.PhoneEvents$ActionHandler.send(PhoneEvents.java:326)
at anywheresoftware.b4a.phone.PhoneEvents$10.handle(PhoneEvents.java:188)
at anywheresoftware.b4a.phone.PhoneEvents$16.onReceive(PhoneEvents.java:268)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:870)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5312)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
java.lang.RuntimeException: Error receiving broadcast Intent { act=b4a.smssent flg=0x10 (has extras) } in anywheresoftware.b4a.phone.PhoneEvents$16@26937a2d
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:880)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5312)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
Caused by: java.lang.RuntimeException: java.io.IOException: Prepare failed.: status=0x80000000
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.phone.PhoneEvents$ActionHandler.send(PhoneEvents.java:326)
at anywheresoftware.b4a.phone.PhoneEvents$10.handle(PhoneEvents.java:188)
at anywheresoftware.b4a.phone.PhoneEvents$16.onReceive(PhoneEvents.java:268)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:870)
... 8 more
Caused by: java.io.IOException: Prepare failed.: status=0x80000000
at android.media.MediaPlayer._prepare(Native Method)
at android.media.MediaPlayer.prepare(MediaPlayer.java:1125)
at anywheresoftware.b4a.objects.MediaPlayerWrapper.loadAfterReset(MediaPlayerWrapper.java:97)
at anywheresoftware.b4a.objects.MediaPlayerWrapper.Load(MediaPlayerWrapper.java:62)
at JK.VigiTrackMobile.jk_class._pev_smssentstatus(jk_class.java:890)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
... 13 more
--------- beginning of crash
 

kohle

Active Member
Licensed User
A while it works fine and than when several sms enter at the same time, the error happen.
I use the "load" at 2 places. See my code.

The .load dont return a status, so how can I check if the file was correct loaded, because I dont get an error message.



It seems to happen here :


Sub PEv_SmsSentStatus (Success As Boolean, ErrorMessage As String, PhoneNumber As String, Intent As Intent)

Dim msg As String
Dim mp As MediaPlayer
mp.Initialize
Dim r As RingtoneManager
mp.Load(r.GetContentDir, r.GetDefault(r.TYPE_NOTIFICATION))

If Success=False Then
ToastMessageShow(lang_string("SMS_NOT_SEND") & " " & ErrorMessage,True)
msg = ErrorMessage
Else
msg=lang_string("SMS_OK")
ToastMessageShow(msg,False)
mp.Play
End If
End Sub
OR HERE :

Sub Service_Create


mpOn.Initialize
mpOn.Load(File.DirAssets,"on.mp3")
mpOn.Looping=False

mpA.Initialize
mpA.load(File.DirAssets,"alarm.mp3")
mpA.Looping=True
 
Top