我正在使用Quickblox库为Android开发视频聊天应用程序。但是我在维护视频聊天会话时遇到了一些错误。当用户以接收者(第二个用户)身份登录时,应用程序会在一段时间后发出崩溃,并提供以下日志输出。
01-28 18:23:20.149: W/System.err(15082): at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:46)
01-28 18:23:20.149: W/System.err(15082): at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:269)
01-28 18:23:20.149: W/System.err(15082): at java.io.DataOutputStream.write(DataOutputStream.java:98)
01-28 18:23:20.149: W/System.err(15082): at java.io.OutputStream.write(OutputStream.java:82)
01-28 18:23:20.149: W/System.err(15082): at com.quickblox.module.videochat.core.senders.TcpPacketsSender$TcpVideoAudioSenderRunnable.run(TcpPacketsSender.java:98)
01-28 18:23:20.149: W/System.err(15082): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
01-28 18:23:20.149: W/System.err(15082): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
01-28 18:23:20.149: W/System.err(15082): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
01-28 18:23:20.149: W/System.err(15082): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
01-28 18:23:20.149: W/System.err(15082): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
01-28 18:23:20.149: W/System.err(15082): at java.lang.Thread.run(Thread.java:856)
01-28 18:23:20.159: W/System.err(15082): Caused by: libcore.io.ErrnoException: sendto failed: EPIPE (Broken pipe)
01-28 18:23:20.159: W/System.err(15082): at libcore.io.Posix.sendtoBytes(Native Method)
01-28 18:23:20.159: W/System.err(15082): at libcore.io.Posix.sendto(Posix.java:146)
01-28 18:23:20.159: W/System.err(15082): at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:177)
01-28 18:23:20.159: W/System.err(15082): at libcore.io.IoBridge.sendto(IoBridge.java:463)
01-28 18:23:20.159: W/System.err(15082): ... 12 more
01-28 18:23:20.199: W/AudioTrack(15082): obtainBuffer() track 0x7e5788 disabled, restarting
01-28 18:23:20.219: W/ilbc-codec(15082): Ignore last 0 bytes
01-28 18:23:20.349: W/System.err(15082): java.net.SocketException: sendto failed: EPIPE (Broken pipe)
01-28 18:23:20.359: W/System.err(15082): at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:496)
01-28 18:23:20.359: W/System.err(15082): at libcore.io.IoBridge.sendto(IoBridge.java:465)
01-28 18:23:20.359: W/System.err(15082): at java.net.PlainSocketImpl.write(PlainSocketImpl.java:507)
01-28 18:23:20.359: W/System.err(15082): at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:46)
01-28 18:23:20.359: W/System.err(15082): at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:269)
01-28 18:23:20.359: W/System.err(15082): at java.io.DataOutputStream.write(DataOutputStream.java:98)
01-28 18:23:20.359: W/System.err(15082): at java.io.OutputStream.write(OutputStream.java:82)
01-28 18:23:20.359: W/System.err(15082): at com.quickblox.module.videochat.core.senders.TcpPacketsSender$TcpVideoAudioSenderRunnable.run(TcpPacketsSender.java:98)
01-28 18:23:20.359: W/System.err(15082): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
01-28 18:23:20.359: W/System.err(15082): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
01-28 18:23:20.359: W/System.err(15082): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
01-28 18:23:20.359: W/System.err(15082): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
01-28 18:23:20.359: W/System.err(15082): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
01-28 18:23:20.359: W/System.err(15082): at java.lang.Thread.run(Thread.java:856)
01-28 18:23:20.359: W/System.err(15082): Caused by: libcore.io.ErrnoException: sendto failed: EPIPE (Broken pipe)
01-28 18:23:20.369: W/System.err(15082): at libcore.io.Posix.sendtoBytes(Native Method)
01-28 18:23:20.369: W/System.err(15082): at libcore.io.Posix.sendto(Posix.java:146)
01-28 18:23:20.369: W/System.err(15082): at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:177)
01-28 18:23:20.369: W/System.err(15082): at libcore.io.IoBridge.sendto(IoBridge.java:463)
01-28 18:23:20.379: W/System.err(15082): ... 12 more
有时会出现AdioRecord错误
java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord.
任何人对此有任何想法或有任何其他库用于聊天应用程序集成? 感谢
EDIT 这里有一些错误,
01-29 16:38:58.831: E/AndroidRuntime(6775): FATAL EXCEPTION: Thread-3039
01-29 16:38:58.831: E/AndroidRuntime(6775): java.lang.ExceptionInInitializerError
01-29 16:38:58.831: E/AndroidRuntime(6775): at com.quickblox.module.videochat.core.AudioRecorder$AudioRecorderRunnable.run(AudioRecorder.java:123)
01-29 16:38:58.831: E/AndroidRuntime(6775): at java.lang.Thread.run(Thread.java:856)
01-29 16:38:58.831: E/AndroidRuntime(6775): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load ilbc-codec: findLibrary returned null
01-29 16:38:58.831: E/AndroidRuntime(6775): at java.lang.Runtime.loadLibrary(Runtime.java:365)
01-29 16:38:58.831: E/AndroidRuntime(6775): at java.lang.System.loadLibrary(System.java:535)
01-29 16:38:58.831: E/AndroidRuntime(6775): at com.googlecode.androidilbc.Codec.<init>(Codec.java:16)
01-29 16:38:58.831: E/AndroidRuntime(6775): at com.googlecode.androidilbc.Codec.<clinit>(Codec.java:5)
01-29 16:38:58.831: E/AndroidRuntime(6775): ... 2 more
01-29 11:01:15.772: E/AndroidRuntime(18705): FATAL EXCEPTION: main
01-29 11:01:15.772: E/AndroidRuntime(18705): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rechargedoctor.android.app/com.quickblox.videochatsample.ui.ActivityVideoChat}: java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord.
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1959)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1984)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.ActivityThread.access$600(ActivityThread.java:126)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1150)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.os.Handler.dispatchMessage(Handler.java:99)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.os.Looper.loop(Looper.java:137)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.ActivityThread.main(ActivityThread.java:4456)
01-29 11:01:15.772: E/AndroidRuntime(18705): at java.lang.reflect.Method.invokeNative(Native Method)
01-29 11:01:15.772: E/AndroidRuntime(18705): at java.lang.reflect.Method.invoke(Method.java:511)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
01-29 11:01:15.772: E/AndroidRuntime(18705): at dalvik.system.NativeStart.main(Native Method)
01-29 11:01:15.772: E/AndroidRuntime(18705): Caused by: java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord.
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.media.AudioRecord.startRecording(AudioRecord.java:534)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.quickblox.module.videochat.core.AudioRecorder$AudioRecorderRunnable.initRecorder(AudioRecorder.java:97)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.quickblox.module.videochat.core.AudioRecorder$AudioRecorderRunnable.<init>(AudioRecorder.java:75)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.quickblox.module.videochat.core.AudioRecorder.startAudioRecorder(AudioRecorder.java:31)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.quickblox.module.videochat.core.service.QBVideoChatService.startVideoChat(QBVideoChatService.java:93)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.quickblox.videochatsample.ui.ActivityVideoChat.initViews(ActivityVideoChat.java:69)
01-29 11:01:15.772: E/AndroidRuntime(18705): at com.quickblox.videochatsample.ui.ActivityVideoChat.onCreate(ActivityVideoChat.java:40)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.Activity.performCreate(Activity.java:4465)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
01-29 11:01:15.772: E/AndroidRuntime(18705): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1923)
01-29 11:01:15.772: E/AndroidRuntime(18705): ... 11 more
答案 0 :(得分:1)
将libs / armeabi / libilbc-codec文件从Sample-VideoChat-android项目复制到新项目中。一切都应该正常。
答案 1 :(得分:0)
首先,检查是否将本机库复制到项目中。如果您收到其他错误,请尝试不要将示例源复制到您的项目中,但请尝试加载并运行视频聊天示例源,您可以在此处找到https://github.com/QuickBlox/Sample-VideoChat-android