使用Android SDK插件(Nativescript-opentok)时,Opentok当前出现错误。使用Maven的SDK版本为2.17。+,该插件来自NativeScript MarketPlace。
我可以连接,也可以订阅另一个使用OpenTok JS 2.15.1的供稿,但是当我使用Android手机发布时,OpenTok会向我返回一个发布者错误:协商超时,该超时不在SDK本身不会抛出它,而是仅在其网站上的Opentok Developer Inspector中可见。我可以授予我的摄像头和麦克风访问权限,因为当我连接到会话时,可以在发布者视图标签中看到自己的摄像头。
此外,我的音频使整个应用程序崩溃。
我添加了一个答案以使问题更清晰,这与设备上的音频权限有关吗?
Adb logcat崩溃报告:
05-26 12:16:40.157 1604 1747 F atrCompanionAp: java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: JNI GetObjectClass called with pending exception java.lang.RuntimeException: Audio capture is not initialized 44100
05-26 12:16:40.157 1604 1747 F atrCompanionAp: java_vm_ext.cc:570] at boolean com.opentok.android.DefaultAudioDevice.initCapturer() ((null):-1)
...之间的堆栈跟踪
05-26 12:16:40.292 1604 1747 F atrCompanionAp: runtime.cc:630] native: #28 pc 000000000043c9d8 /apex/com.android.runtime/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+52)
05-26 12:16:40.292 1604 1747 F atrCompanionAp: runtime.cc:630] native: #00 pc 000000000008033c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
05-26 12:16:40.292 1604 1747 F atrCompanionAp: runtime.cc:630] | held mutexes=
05-26 12:16:40.292 1604 1747 F atrCompanionAp: runtime.cc:630] at java.lang.Object.wait(Object.java:442)
05-26 12:16:40.292 1604 1747 F atrCompanionAp: runtime.cc:630] native: #05 pc 00000000001db8d4 /data/app/org.nativescript.AvatrCompanionApp-vK0zREAM_BobIo-Eksgn2Q==/lib/arm64/libopentok.so (???)
05-26 12:16:40.292 1604 1747 F atrCompanionAp: runtime.cc:630] (no managed stack frames)
05-26 12:16:40.293 1604 1747 F atrCompanionAp: runtime.cc:630] (no managed stack frames)
05-26 12:16:40.293 1604 1747 F atrCompanionAp: runtime.cc:630] native: #10 pc 00000000003582bc /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::CheckJNI::GetObjectClass(_JNIEnv*, _jobject*)+668)
05-26 12:16:40.293 1604 1747 F atrCompanionAp: runtime.cc:630] native: #23 pc 0000000000084b6c /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
05-26 12:16:40.293 1604 1747 F atrCompanionAp: runtime.cc:638] JNI DETECTED ERROR IN APPLICATION: JNI GetObjectClass called with pending exception java.lang.RuntimeException: Audio capture is not initialized 44100
过去有人收到此错误吗?如果是这样,您是否会知道为什么会有超时?
谢谢!
答案 0 :(得分:1)
已解决,已接受的答案。
为了对以后的所有人有所帮助,我将说明如何解决此问题:只需确保在打开OpenTok
之前先进行验证,您实际上已获得用户对麦克风的设备许可,否则可能会使应用崩溃。在使用Nativescript
的特定情况下,显示对话框,直到您允许他们这样做为止。无法确认是否发生在其他框架上!