我只想在我的应用程序中使用sinch进行呼叫,到目前为止,我已经在官方documentation上关注,所以在此链接之后,我将按照以下方式构建Sinch客户端:
private var sinchClient: SinchClient? = null
private fun initSinchClient() {
sinchClient = Sinch.getSinchClientBuilder().context(this@CallNewActivity)
.applicationKey(APP_KEY)
.applicationSecret(APP_SECRET)
.environmentHost(ENVIRONMENT)
.userId("uName1234")
.build()
sinchClient!!.checkManifest()
}
接下来什么都没有了,问题在于执行此代码后我的应用程序刚崩溃!唯一的例外是:
----- class 'Lorg/webrtc/voiceengine/WebRtcAudioManager;' cl=0x134c27e0 -----
objectSize=194 (172 from super)
access=0x0008.0001
super='java.lang.Class<java.lang.Object>' (cl=0x0)
vtable (1 entries, 11 in super):
0: boolean org.webrtc.voiceengine.WebRtcAudioManager.isLowLatencyInputSupported()
direct methods (26 entries):
0: void org.webrtc.voiceengine.WebRtcAudioManager.<clinit>()
1: void org.webrtc.voiceengine.WebRtcAudioManager.<init>(long)
2: void org.webrtc.voiceengine.WebRtcAudioManager.assertTrue(boolean)
3: void org.webrtc.voiceengine.WebRtcAudioManager.dispose()
4: int org.webrtc.voiceengine.WebRtcAudioManager.getLowLatencyInputFramesPerBuffer()
5: int org.webrtc.voiceengine.WebRtcAudioManager.getLowLatencyOutputFramesPerBuffer()
6: int org.webrtc.voiceengine.WebRtcAudioManager.getMinInputFrameSize(int, int)
7: int org.webrtc.voiceengine.WebRtcAudioManager.getMinOutputFrameSize(int, int)
8: int org.webrtc.voiceengine.WebRtcAudioManager.getNativeOutputSampleRate()
9: int org.webrtc.voiceengine.WebRtcAudioManager.getSampleRateOnJellyBeanMR10OrHigher()
10: boolean org.webrtc.voiceengine.WebRtcAudioManager.getStereoInput()
11: boolean org.webrtc.voiceengine.WebRtcAudioManager.getStereoOutput()
12: boolean org.webrtc.voiceengine.WebRtcAudioManager.hasEarpiece()
13: boolean org.webrtc.voiceengine.WebRtcAudioManager.init()
14: boolean org.webrtc.voiceengine.WebRtcAudioManager.isAAudioSupported()
15: boolean org.webrtc.voiceengine.WebRtcAudioManager.isAcousticEchoCancelerSupported()
16: boolean org.webrtc.voiceengine.WebRtcAudioManager.isCommunicationModeEnabled()
17: boolean org.webrtc.voiceengine.WebRtcAudioManager.isDeviceBlacklistedForOpenSLESUsage()
18: boolean org.webrtc.voiceengine.WebRtcAudioManager.isLowLatencyOutputSupported()
19: boolean org.webrtc.voiceengine.WebRtcAudioManager.isNoiseSuppressorSupported()
20: boolean org.webrtc.voiceengine.WebRtcAudioManager.isProAudioSupported()
21: void org.webrtc.voiceengine.WebRtcAudioManager.nativeCacheAudioParameters(int, int, int, boolean, boolean, boolean, boolean, boolean, boolean, boolean, int, int, long)
22: void org.webrtc.voiceengine.WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(boolean)
23: void org.webrtc.voiceengine.WebRtcAudioManager.setStereoInput(boolean)
24: void org.webrtc.voiceengine.WebRtcAudioManager.setStereoOutput(boolean)
25: void org.webrtc.voiceengine.WebRtcAudioManager.storeAudioParameters()
static fields (9 entries):
0: int org.webrtc.voiceengine.WebRtcAudioManager.BITS_PER_SAMPLE
1: boolean org.webrtc.voiceengine.WebRtcAudioManager.DEBUG
2: int org.webrtc.voiceengine.WebRtcAudioManager.DEFAULT_FRAME_PER_BUFFER
3: java.lang.String org.webrtc.voiceengine.WebRtcAudioManager.TAG
4: boolean org.webrtc.voiceengine.WebRtcAudioManager.blacklistDeviceForAAudioUsage
5: boolean org.webrtc.voiceengine.WebRtcAudioManager.blacklistDeviceForOpenSLESUsage
6: boolean org.webrtc.voiceengine.WebRtcAudioManager.blacklistDeviceForOpenSLESUsageIsOverridden
7: boolean org.webrtc.voiceengine.WebRtcAudioManager.useStereoInput
8: boolean org.webrtc.voiceengine.WebRtcAudioManager.useStereoOutput
instance fields (18 entries):
0: boolean org.webrtc.voiceengine.WebRtcAudioManager.aAudio
1: android.media.AudioManager org.webrtc.voiceengine.WebRtcAudioManager.audioManager
2: boolean org.webrtc.voiceengine.WebRtcAudioManager.hardwareAEC
3: boolean org.webrtc.voiceengine.WebRtcAudioManager.hardwareAGC
4: boolean org.webrtc.voiceengine.WebRtcAudioManager.hardwareNS
5: boolean org.webrtc.voiceengine.WebRtcAudioManager.initialized
6: int org.webrtc.voiceengine.WebRtcAudioManager.inputBufferSize
7: int org.webrtc.voiceengine.WebRtcAudioManager.inputChannels
8: boolean org.webrtc.voiceengine.WebRtcAudioManager.lowLatencyInput
9: boolean org.webrtc.voiceengine.WebRtcAudioManager.lowLatencyOutput
10: long org.webrtc.voiceengine.WebRtcAudioManager.nativeAudioManager
11: int org.webrtc.voiceengine.WebRtcAudioManager.nativeChannels
12: int org.webrtc.voiceengine.WebRtcAudioManager.nativeSampleRate
13: int org.webrtc.voiceengine.WebRtcAudioManager.outputBufferSize
14: int org.webrtc.voiceengine.WebRtcAudioManager.outputChannels
15: boolean org.webrtc.voiceengine.WebRtcAudioManager.proAudio
16: int org.webrtc.voiceengine.WebRtcAudioManager.sampleRate
17: org.webrtc.voiceengine.WebRtcAudioManager$VolumeLogger org.webrtc.voiceengine.WebRtcAudioManager.volumeLogger
Failed to register native method org.webrtc.voiceengine.WebRtcAudioManager.nativeCacheAudioParameters(IIIZZZZZZIIJ)V in /data/app/com.meftii.doctor.e.visit-xRk9IdVgiR8jI85gaiv7CQ==/base.apk!classes3.dex
2019-09-19 15:41:44.987 9189-9308/com.meftii.doctor.e.visit E/rtc: #
# Fatal error in ../../../modules/utility/source/jvm_android.cc, line 200
# last system error: 0
# Check failed: !jni_->ExceptionCheck()
# Error during RegisterNatives
#
--------- beginning of crash
2019-09-19 15:41:44.988 9189-9308/com.meftii.doctor.e.visit A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 9308 (Thread-15), pid 9189 (.doctor.e.visit)
那么对于这个问题,有人可以确定我在做什么错,这一切异常是什么意思?我是第一次集成此sdk,也已经使用了官方资源;但我找不到导致此崩溃的任何信息。预先感谢
答案 0 :(得分:0)
您应该先运行Android Sample Calling Push应用。在SDK包随附的Samples文件夹中可用。
https://download.sinch.com/android/3.15.0/sinch-android-rtc-3.15.0.zip
这是一个类似的示例代码,效果很好。
mSinchClient = Sinch.getSinchClientBuilder()
.context(getApplicationContext())
.userId("uName1234")
.applicationKey(APP_KEY)
.applicationSecret(APP_SECRET)
.environmentHost(ENVIRONMENT).build();
Sinch语音和视频团队