Audio call , Video call crash and voice is not audible

We tried out the sample android code which required to develop our android application

Please make a call schedule with Cometchat android developers

While checking this code we are facing crash on making audio and video call.

On media sharing we are not able to share the voice message properly.On receiving end we are getting the crashed voice mp3 message.

In Some phone call working but most of the time we are facing the crash.

Kindly help us to resolve this issue ASAP.

1 Like

Hello @aupriya
Can you please confirm the version of the CometChat Android SDK you are using so that we can get this checked at our end and help you out with a solution at the earliest.

Hi @aditya.gokula

implementation ‘com.cometchat:pro-android-chat-sdk:2.0.2’

So that example code contain this sdk version. API version is v2. Region is us

1 Like

Hello @aupriya
Can you also please share the crash logs with us so that we can debug this issue better and get to the root of this

Hello aditya.gokula

Shared my log and you can on second voice message received in showing incorrect duration and its not playing

2757-2769/com.inscripts.cometchatpulse.demo E/MediaPlayer: error (1, -2147483648)
01-27 17:13:35.204 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: java.io.IOException: Prepare failed.: status=0x1
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.media.MediaPlayer._prepare(Native Method)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.media.MediaPlayer.prepare(MediaPlayer.java:1158)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at com.inscripts.cometchatpulse.demo.Adapter.OneToOneAdapter.onBindViewHolder(OneToOneAdapter.java:576)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
01-27 17:13:35.205 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4194)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.View.layout(View.java:16651)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5440)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.View.layout(View.java:16651)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5440)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.View.layout(View.java:16651)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5440)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.View.layout(View.java:16651)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5440)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.View.layout(View.java:16651)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5440)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.View.layout(View.java:16651)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5440)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.View.layout(View.java:16651)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5440)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.View.layout(View.java:16651)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5440)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2183)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1943)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1119)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6060)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:670)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.Choreographer.doFrame(Choreographer.java:606)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.os.Handler.handleCallback(Handler.java:746)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.os.Looper.loop(Looper.java:148)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5443)
01-27 17:13:35.206 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at java.lang.reflect.Method.invoke(Native Method)
01-27 17:13:35.207 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
01-27 17:13:35.207 2757-2757/com.inscripts.cometchatpulse.demo W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

1 Like

hi @aditya.gokula,
Shared the log above

Hey @Priyadarshni

The exception java.io.IOException is checked when calling .prepare() on MediaRecorder. The exception is thrown when the audio file is not available or not in a valid format etc. That would be the reason for the wrong time duration. We will surely look into it and get back to you with a solution.

Also, please share the crash logs for Audio and Video call crashes so that we can help you with that.

1 Like

Hi @mangesh.yadav,
Yes the voice message which we received seems corrupted. I have checked the downloaded voice message in folder…which gives message as corrupted file on audio player.

And on seeing the message received log… the mp3 voice message uploaded link also seems corrupted. Kindly look on this. i will share you the audio and video crash report shortly.

Crash log – after receiving the audio call the app closed automatically.
01-28 16:55:17.846 19788-19788/com.advengers.mabo E/IncomingAudioHelper: Stopping ringer
01-28 16:55:17.850 19788-19788/com.advengers.mabo E/IncomingAudioHelper: Cancelling vibrator
01-28 16:55:20.285 19788-19788/com.advengers.mabo E/CallActivity: sessionId 1580210714924649f61ee54f04f3eafa8e9e46f218f84c12fe
01-28 16:55:22.189 19788-19788/com.advengers.mabo E/IncomingAudioHelper: Cancelling vibrator
01-28 16:55:35.320 19788-19943/com.advengers.mabo E/rtc: #
# Fatal error in: gen/sdk/android/generated_base_jni/jni/…/…/…/…/…/…/…/sdk/android/src/jni/jni_generator_helper.h, line 85
# last system error: 0
# Check failed: !env->ExceptionCheck()
#
01-28 16:55:35.320 19788-19943/com.advengers.mabo A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 19943 (signaling_threa)

Hi @mangesh.yadav

01-28 17:04:26.179 20666-20666/com.advengers.mabo E/IncomingAudioHelper: Cancelling vibrator
01-28 17:04:26.180 20666-20666/com.advengers.mabo E/MediaPlayer: stop called in state 0
01-28 17:04:26.180 20666-20666/com.advengers.mabo E/MediaPlayer: error (-38, 0)
01-28 17:04:39.257 20666-20841/com.advengers.mabo E/rtc: #
# Fatal error in: gen/sdk/android/generated_base_jni/jni/…/…/…/…/…/…/…/sdk/android/src/jni/jni_generator_helper.h, line 85
# last system error: 0
# Check failed: !env->ExceptionCheck()
#

--------- beginning of crash

01-28 17:04:39.257 20666-20841/com.advengers.mabo A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 20841 (signaling_threa)

STACK_TRACE=java.lang.NullPointerException: Attempt to invoke virtual method ‘android.content.res.AssetManager android.content.Context.getAssets()’ on a null object reference
at com.advengers.mabo.Cometchat.Utils.FontUtils.initFonts(FontUtils.java:28)
at com.advengers.mabo.Cometchat.Utils.FontUtils.(FontUtils.java:22)
at com.advengers.mabo.Cometchat.Adapter.RecentsListAdapter.(RecentsListAdapter.java:58)
at com.advengers.mabo.Cometchat.Fragments.RecentsFragment.setRecentAdapter(RecentsFragment.java:147)
at com.advengers.mabo.Cometchat.Presenters.RecentsListPresenter$1.onSuccess(RecentsListPresenter.java:37)
at com.advengers.mabo.Cometchat.Presenters.RecentsListPresenter$1.onSuccess(RecentsListPresenter.java:32)
at com.cometchat.pro.core.ConversationsRequest$3$2.run(ConversationsRequest.java:103)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

1 Like

Reply us to resolve this

Hey @aupriya

We have identified the issue. Please add new FontUtils(this); in onCreate() of your Application class to resolve it. We’ll fix the issue in our next release.

1 Like

Hi Team,
Thanks
I will change it

1 Like

@mangesh.yadav,

Yes the voice message which we received seems corrupted. I have checked the downloaded voice message in folder…which gives message as corrupted file on audio player.

And on seeing the message received log… the mp3 voice message uploaded link also seems corrupted

What is the solution for this

1 Like

Hey @aupriya

The messages are corrupted because it’s not getting recorded properly.

We will look into this and get back to you with solution.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.